Skip to content

fix(llm): remove 1M context toggle, always run on 200K window - #13

Merged
limboinf merged 1 commit into
mainfrom
remove-1m-context-toggle
Sep 16, 2026
Merged

limboinf merged 1 commit into
mainfrom
remove-1m-context-toggle

Conversation

@limboinf

Copy link
Copy Markdown
Owner

Why

The Extended Context (1M) toggle opted Anthropic requests into the context-1m-2025-08-07 beta:

  • over-200K requests bill at higher rates
  • lower-tier API keys fail outright with 400 (issue #567)

The interceptor now always strips the SDK-injected context-1m beta header, so every Anthropic request stays on the standard 200K window.

What changed

Full-chain removal of the feature:

  • Settings UI toggle + handler (AiSettingsPage.tsx)
  • Electron preload types & channel map
  • Server-core RPC handlers
  • Protocol channel constants
  • Config storage (get/setEnable1MContext, StoredConfig field)
  • interceptor-common helper
  • en/zh-Hans i18n strings
  • CHANGELOG "Removed" entry

Stale enable1MContext keys 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.

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.
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review partially complete: 0 finding(s); 9 of 11 selected item(s) failed.

@limboinf

Copy link
Copy Markdown
Owner Author

/open-code-review

1 similar comment
@limboinf

Copy link
Copy Markdown
Owner Author

/open-code-review

@limboinf
limboinf merged commit 680eb1e into main Sep 16, 2026
5 checks passed
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.

1 participant