Skip to content

fix(catalog): exclude generic 128k default from combo context min() (#10734) - #10793

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
Prudhvivuda:fix/10734-combo-context-generic-default
Aug 20, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.50from
Prudhvivuda:fix/10734-combo-context-generic-default

Conversation

@Prudhvivuda

@Prudhvivuda Prudhvivuda commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Combo context_length in /v1/models is the min of sourced member windows only (canonical window or a provider/model-specific token limit).
  • getTokenLimit()'s generic 128000 catch-all (specific: false) is no longer treated as a known window, so a 500k combo is not advertised as 128k because an unsourced or generic-default member entered min().
  • Explicit combo context_length overrides still win. Nested combo-refs inherit the same sourced-min rule.

Closes #10734

⚠️ base-red inherited: #9985

Test plan

  • node --import tsx/esm --test tests/unit/combo-context-generic-default-10734.test.ts
  • node --import tsx/esm --test tests/unit/combo-context-prefix-resolution.test.ts
  • node --import tsx/esm --test tests/unit/models-catalog-combo-metadata.test.ts
  • node --import tsx/esm --test tests/unit/resolveComboContextLimit.test.ts
  • GET /v1/models for a combo whose catalogued members are 500k (plus an unsourced member) advertises 500000, not 128000

@diegosouzapw

Copy link
Copy Markdown
Owner

Verified this fix end-to-end -- the production change is correct and does what the title says.

Confirmation: I built a real (not fabricated) combo {glm/glm-5.2, aimlapi/deepseek-chat} -- aimlapi/deepseek-chat is a genuinely registered model whose resolveTokenLimit() falls through to the generic 128k catch-all (specific: false), matching the exact scenario in #10734. With this PR's getSourcedTokenLimit() in place, computeComboContextLength() returns 1000000 as expected. Reverting just the two getSourcedTokenLimit call sites back to getTokenLimit reproduces the bug exactly (128000). All 4 tests named in the test plan pass, plus the shipped combo-context-generic-default-10734.test.ts suite (7/7).

One suggestion (non-blocking): 3 of the 7 shipped tests -- including the flagship "GET /v1/models does not advertise 128k" integration test -- use not-a-real-provider/no-such-model as the "unsourced member" fixture. That model is filtered out by a separate, pre-existing gate (getCanonicalModelMetadata's source check for "not registered in any source at all"), independent of this fix. I confirmed this by reverting the production change and re-running the suite: all 7 tests still pass unchanged. Only the 4 lower-level resolveTokenLimit/getSourcedTokenLimit unit tests actually fail without the fix.

For a regression guard that actually exercises getComboTargetCatalogMetadata/computeComboContextLength's new branch, consider swapping that fixture for a real registered-but-unsourced model (e.g. aimlapi/deepseek-chat, or any PROVIDER_MODELS entry with no canonical contextWindow and no REGISTRY.defaultContextLength/DEFAULT_LIMITS entry for its provider) in a follow-up. Doesn't block this PR -- the production fix is sound and well-scoped as-is.

⚠️ Noted: base-red #9985 is correctly flagged in the PR body.

@diegosouzapw
diegosouzapw merged commit c00086e into diegosouzapw:release/v3.8.50 Aug 20, 2026
5 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…iegosouzapw#10734) (diegosouzapw#10793)

Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution!
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.

fix(catalog): combo context_length advertised as 128k when members are 500k (generic default counted in min())

2 participants