Repository navigation
fix(agents): resolve fable-5 1M context window for claude-cli provider - #101368
xialonglee wants to merge 1 commit into
Conversation
The resolveAnthropicFixedContextWindow fable-5 guard only matched anthropic and anthropic-vertex providers, leaving claude-cli unhandled. Without this, claude-cli + claude-fable-5 fell through to the GA 1M prefix check where fable-5 doesn't match, returning undefined and causing fallback to the default 200K context window. Both call paths were affected: - resolveContextTokensForModelFromCache (direct) - resolveDiscoveredAnthropicFixedContextWindow (discovery cache upgrade) Same root cause as openclaw#100572: new model added to catalog but claude-cli provider boundary was not enumerated. Fix: add provider === 'claude-cli' to the fable-5 guard, matching the pattern already used by the GA 1M guard on the next branch.
13b9324 to
4a1919d
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 2:26 PM ET / 18:26 UTC. Summary PR surface: Source 0, Tests +5. Total +5 across 2 files. Reproducibility: yes. Source inspection shows current main excludes Review metrics: none identified. Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land this narrow resolver fix if maintainers want the immediate context-budget repair, then reconcile or retarget the overlapping broader Claude CLI Fable 5 metadata PR. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main excludes Is this the best way to solve the issue? Yes for the submitted narrow bug fix. Extending the existing fixed-window guard is the right layer for direct and discovery-cache context resolution; broader allowlist and catalog work remains separate in #101453. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against dd228d5f3cee. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +5. Total +5 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (6 earlier review cycles)
|
ba64fc1 to
4a1919d
Compare
|
Closing as a partial duplicate of #101453. That PR includes this same context-window correction and also updates the Anthropic CLI allowlist, aliases, labels, catalog, and migration coverage, so landing this branch separately would leave the provider surfaces inconsistent. Thanks for the fix; the broader canonical PR preserves the work. |
What Problem This Solves
claude-cli + claude-fable-5falls back to the default 200K context window instead of 1M. TheresolveAnthropicFixedContextWindowFable 5 guard only matchedanthropicandanthropic-vertexproviders, leavingclaude-cliunhandled.Both call paths were affected:
resolveContextTokensForModelFromCache(direct context resolution)resolveDiscoveredAnthropicFixedContextWindow(discovery cache upgrade)Same root cause as #100572: a new model was added to the catalog but the
claude-cliprovider boundary was not enumerated in the Fable 5 guard.Why This Change Was Made
Add
provider === 'claude-cli'to the existing Fable 5 fixed-window guard, matching the pattern already used by the Mythos 5 / Sonnet 5 guards and the GA 1M prefix check on the next branch.User Impact
claude-cli/claude-fable-5now correctly resolves to 1,000,000 token context window viaANTHROPIC_FABLE_CONTEXT_TOKENS. All three Anthropic-affiliated providers (anthropic, anthropic-vertex, claude-cli) now receive the correct fixed context window for Fable 5.Evidence
Unit tests (66 passed, 0 failed)
Real behavior proof —
resolveAnthropicFixedContextWindowlive outputA proof script exercised
resolveAnthropicFixedContextWindow()directly against the production source to verify thatclaude-cli/claude-fable-5resolves to the correct 1M context window:Key coverage:
Real environment tested: Linux Node 24, commit 4a1919d, branch fix/gap-ctx-claude-cli-fable5-context-window
Exact command run:
npx tsx scripts/proof-context-resolution.mjs(exercisingresolveAnthropicFixedContextWindowfrom production source)What was not tested: Live gateway end-to-end with actual claude-cli provider subscription (requires Claude CLI subscription and API key)