fix(llm): remove 1M context toggle, always run on 200K window - #13
Merged
Merged
Conversation
The Extended Context (1M) toggle opted Anthropic requests into the context-1m beta, which bills over-200K requests at higher rates and 400s outright on lower-tier API keys (issue #567). The interceptor now always strips the SDK-injected context-1m beta header. Removal spans the full chain: settings UI toggle, electron preload types and channel map, RPC handlers, protocol channels, config storage, interceptor helper, and en/zh-Hans i18n strings. Stale enable1MContext keys in existing configs are harmlessly ignored.
|
✅ OpenCodeReview: Review partially complete: 0 finding(s); 9 of 11 selected item(s) failed. |
Owner
Author
|
/open-code-review |
1 similar comment
Owner
Author
|
/open-code-review |
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.
Why
The Extended Context (1M) toggle opted Anthropic requests into the
context-1m-2025-08-07beta:The interceptor now always strips the SDK-injected
context-1mbeta header, so every Anthropic request stays on the standard 200K window.What changed
Full-chain removal of the feature:
AiSettingsPage.tsx)get/setEnable1MContext,StoredConfigfield)interceptor-commonhelperStale
enable1MContextkeys left in existing user configs are harmlessly ignored (lenient JSON parse).Review notes
Local OCR pre-review: 0 critical / 0 high / 0 medium, 2 low (empty-header nit in
stripBetaHeader+ missing regression test for the always-strip behavior).This PR also validates the new CI code-review workflow (
ocr-review.yml) — it should run automatically on open.