Skip to content

feat(models): match relay ids with a month-day date suffix against the catalog - #793

Draft
L4XB wants to merge 1 commit into
Stack-Cairn:mainfrom
L4XB:feat/catalog-match-short-date-suffix
Draft

feat(models): match relay ids with a month-day date suffix against the catalog#793
L4XB wants to merge 1 commit into
Stack-Cairn:mainfrom
L4XB:feat/catalog-match-short-date-suffix

Conversation

@L4XB

@L4XB L4XB commented Sep 11, 2026

Copy link
Copy Markdown

Closes #794 (split out of #786, part 2 of that report: catalog matching for dated relay ids; part 1 stays tracked in #786)

Problem

Relays often expose an official model as <vendor>/<id>-MMDD, e.g. deepseek-ai/deepseek-v4-pro-0813. normalizeModelIdCandidates in crates/agent-ui/src/lib/models/modelCatalog.ts already strips the vendor prefix and a full -YYYYMMDD date, but not the four-digit month-day form. The id therefore missed deepseek-v4-pro (contextWindow 1,000,000 / maxOutputToken 384,000) and getProviderModelDefaults fell back to the provider's default limits (400,000 / 142,000 in the report), which undercounts the window by about half and makes the auto-compaction threshold fire far too early.

Change

  • A trailing -MMDD is stripped as an additional candidate, only when no full date is present and only for a valid month and day (-2024, -1345 and similar are left alone). This applies to the raw id and, at the end of the chain as before, to its last path segment.
  • Candidate order is unchanged: exact forms first, so an id that exists in the catalog with its date (deepseek-r1-0528) keeps matching its own entry; deepseek-r1-0601 resolves to deepseek-r1.

Not included: part 1 of the report (a configurable auto-compaction threshold). That is a settings surface in crates/agent-gui/src/lib/chat/compaction/policy.ts and worth its own change; this one only fixes the catalog miss that made the current threshold fire early.

Tests

crates/agent-gui/test/models/model-catalog.test.mjs

  • candidate chain for deepseek-ai/deepseek-v4-pro-0813 (vendor prefix and month-day suffix, in order), and no stripping for gpt-4o-2024 / model-1345;
  • findCatalogModelAcrossProviders("deepseek-ai/deepseek-v4-pro-0813") resolves to deepseek-v4-pro with the 1,000,000 window, deepseek-r1-0528 keeps its own entry, deepseek-r1-0601 resolves to deepseek-r1.

node scripts/run-node-tests.mjs --include-prefix model-catalog crates/agent-gui/test: 12 pass (fails on main for the two new cases). biome check and tsc --noEmit in crates/agent-ui are clean.

Screenshots / preview

No visual change: the change is a lookup helper in crates/agent-ui/src/lib/models/modelCatalog.ts (candidate chain for catalog matching) plus its unit tests. Nothing rendered differs; the effect is that the model's context window resolves to the catalog value instead of the provider fallback, which the test output pins.

Observable effect, in numbers rather than pixels, for deepseek-ai/deepseek-v4-pro-0813:

contextWindow maxOutputToken source
before 400,000 142,000 provider default (catalog miss)
after 1,000,000 384,000 catalog entry deepseek-v4-pro

The governance check flags this PR because crates/agent-ui/src/ is in its UI path list, but the file it touches has no rendered surface, so there is no before/after frame to capture. Happy to add anything else that would serve as evidence here.

…e catalog

Relays often expose an official model as `<vendor>/<id>-MMDD`, for
example deepseek-ai/deepseek-v4-pro-0813. The candidate chain already
strips a vendor prefix and a full -YYYYMMDD date, but not the four-digit
month-day form, so the id missed the catalog entry and fell back to the
provider's default limits, which undercounted the context window by
about half and made auto-compaction fire far too early (Stack-Cairn#786, part 2).

Strip a trailing -MMDD (valid month and day only) when no full date is
present, for both the raw id and its last path segment. An id that
exists in the catalog with its date, such as deepseek-r1-0528, still
matches itself first.
@StackCairn
StackCairn marked this pull request as draft September 11, 2026 12:23
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

PR governance checks failed — this PR has been converted to draft.

  • UI change without screenshots: this PR modifies frontend code. Please add before/after screenshots or a recording under "Screenshots / preview" in the PR body.

Fix the items above, then click Ready for review to re-run the checks.

@L4XB

L4XB commented Sep 11, 2026

Copy link
Copy Markdown
Author

The governance check converted this to a draft because it treats any change under crates/agent-ui/src/ as a UI change and requires a screenshot. This PR changes only the catalog lookup helper (normalizeModelIdCandidates) and its unit tests; nothing rendered differs, so there is no before/after to capture. I have linked the split-out issue #794 with Closes, added the "Screenshots / preview" section explaining this, and left the PR in draft rather than fighting the bot. If a maintainer is fine with the exemption, marking it ready for review is all that is needed; happy to adjust anything else.

@L4XB
L4XB marked this pull request as ready for review September 12, 2026 08:06
@StackCairn
StackCairn marked this pull request as draft September 12, 2026 08:06
@L4XB

L4XB commented Sep 12, 2026

Copy link
Copy Markdown
Author

Governance re-ran at 34682414515: the linked-issue problem is gone (#794 is open and referenced with Closes), and one rule is left.

UI change without screenshots: this PR modifies frontend code.

The rule fires on the path, not on the change: it treats every file under crates/agent-ui/src/ as a UI change, and this PR touches exactly one of them, lib/models/modelCatalog.ts, which is a pure lookup helper (normalizeModelIdCandidates) with no rendered surface. There is no before/after frame to capture, so I cannot satisfy the rule honestly, and I would rather say that than attach an unrelated image to get the check green.

The observable effect is in the PR body as a table instead: for deepseek-ai/deepseek-v4-pro-0813 the context window resolves to 1,000,000 / 384,000 from the catalog entry instead of the provider fallback of 400,000 / 142,000, which is what the two new tests pin.

This now needs a maintainer decision: either waive the screenshot requirement for this one (marking it ready for review is enough, the bot only redrafts on a failing rule), or tell me what you would accept as evidence and I will produce it. If it would help generally, I am happy to open a separate PR narrowing the UI path list so that lib/models/ and similar non-rendering directories do not trigger the screenshot rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Relay model ids with a month-day date suffix (deepseek-ai/deepseek-v4-pro-0813) miss the built-in catalog

1 participant