feat(models): match relay ids with a month-day date suffix against the catalog - #793
feat(models): match relay ids with a month-day date suffix against the catalog#793L4XB wants to merge 1 commit into
Conversation
…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.
|
PR governance checks failed — this PR has been converted to draft.
Fix the items above, then click Ready for review to re-run the checks. |
|
The governance check converted this to a draft because it treats any change under |
|
Governance re-ran at
The rule fires on the path, not on the change: it treats every file under The observable effect is in the PR body as a table instead: for 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 |
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.normalizeModelIdCandidatesincrates/agent-ui/src/lib/models/modelCatalog.tsalready strips the vendor prefix and a full-YYYYMMDDdate, but not the four-digit month-day form. The id therefore misseddeepseek-v4-pro(contextWindow 1,000,000 / maxOutputToken 384,000) andgetProviderModelDefaultsfell 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
-MMDDis stripped as an additional candidate, only when no full date is present and only for a valid month and day (-2024,-1345and similar are left alone). This applies to the raw id and, at the end of the chain as before, to its last path segment.deepseek-r1-0528) keeps matching its own entry;deepseek-r1-0601resolves todeepseek-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.tsand 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.mjsdeepseek-ai/deepseek-v4-pro-0813(vendor prefix and month-day suffix, in order), and no stripping forgpt-4o-2024/model-1345;findCatalogModelAcrossProviders("deepseek-ai/deepseek-v4-pro-0813")resolves todeepseek-v4-prowith the 1,000,000 window,deepseek-r1-0528keeps its own entry,deepseek-r1-0601resolves todeepseek-r1.node scripts/run-node-tests.mjs --include-prefix model-catalog crates/agent-gui/test: 12 pass (fails onmainfor the two new cases).biome checkandtsc --noEmitincrates/agent-uiare 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:deepseek-v4-proThe 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.