fix(server): force Claude 200k context when selected/(default)#2690
fix(server): force Claude 200k context when selected/(default)#2690lostf1sh wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR changes the default Claude context window from 1M to 200k for all users, which is a significant runtime behavior change. While the implementation is clean and well-tested, changes affecting default application behavior warrant human review to confirm intent. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Fixed Claude context window handling so T3 Code’s 200k selection actually disables Claude Code’s automatic 1M context upgrade.
When 1M is explicitly selected, T3 Code still uses the
[1m]model suffix and clears the disable flag.Why
When you start coding with Claude in t3code, 200k is selected by default, but this doesn’t work—the model automatically sets itself to a 1M context window. This fix involves adding the “CLAUDE_CODE_DISABLE_1M_CONTEXT=1” flag directly to the environment and running it; you can also switch between 1M and 200k during the conversation.
Before :

After:

Checklist
Note
Medium Risk
Changes runtime environment passed into Claude Code sessions based on the selected
contextWindow, which can affect model behavior across all Claude sessions; covered by targeted adapter tests but still touches core provider session startup.Overview
For Claude provider session startup, the adapter now derives the effective
contextWindowselection from provider option descriptors and injects/removesCLAUDE_CODE_DISABLE_1M_CONTEXTin the SDKenvto prevent Claude Code from auto-upgrading to 1M when 200k (the default) is intended.Adds tests verifying: selecting
200k(and the default selection) sets the disable flag, and explicitly selecting1mclears the flag even if the process environment had it set.Reviewed by Cursor Bugbot for commit acb6057. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Force 200k Claude context window by setting
CLAUDE_CODE_DISABLE_1M_CONTEXTby defaultresolveClaudeOneMillionContextDisabledin ClaudeAdapter.ts to check thecontextWindowprovider option: returnstrue(disable 1M) when the value is200kor absent, andfalsewhen explicitly set to1m.withClaudeContextWindowEnvironmentto conditionally set or removeCLAUDE_CODE_DISABLE_1M_CONTEXTin the env passed to Claude queries.1mcontext, the env variable is removed and[1m]is appended to the model name to override any process-level disable.CLAUDE_CODE_DISABLE_1M_CONTEXT=1is now injected by default (200k is the default context window), overriding any external env that had previously enabled 1M context silently.Macroscope summarized acb6057.