Repository navigation
fix(kiro): stop discovery from stamping a fake 200k context window - #15413
Merged
diegosouzapw merged 1 commit intoOct 6, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
Kiro ListAvailableModels can omit tokenLimits.maxInputTokens. The variant expander filled in 200000, which modelDiscovery persists as inputTokenLimit and the Feature 5004 reconciler then pins as an auto:discovery override over the registry / models.dev window (claude-sonnet-5 is 1M). Only carry the upstream number; models without one stay unadvertised so the catalog decides.
QuangBlue
force-pushed
the
fix/kiro-discovery-context-window
branch
from
October 3, 2026 05:28
ba92af4 to
6af6dd2
Compare
diegosouzapw
merged commit Oct 6, 2026
204de62
into
diegosouzapw:release/v3.8.52
44 of 51 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
A Kiro model whose
ListAvailableModelsentry lackstokenLimits.maxInputTokensis advertised with a 200k window, even when the registry or models.dev knows a larger one (claude-sonnet-5 is 1M).Root cause
fetchKiroAvailableModelsexpands each upstream model into variants withcontextLength: Number(tokenLimits.maxInputTokens) || 200000.modelDiscoverypersistscontextLengthas the discoveredinputTokenLimit, and the Feature 5004 reconciler pins any discovered window that differs from the catalog as anauto:discoveryoverride. The invented 200k therefore beats the real window.Fix
Only carry the upstream
maxInputTokens. When it is missing, the variant has nocontextLength, so the catalog decides.KiroModel.contextLengthis already optional, and the executor's usage-percentage budget reads the registry, not discovery, so it is unaffected.Tests
tests/unit/kiro-available-models.test.ts: a model withouttokenLimitshas nocontextLength, and a declaredmaxInputTokensis kept. It fails on the base and passes with the fix.kiro-available-models,kiro-claude-sonnet-5-2267,provider-models-config,executor-kiro) pass (50).