Skip to content

fix(server): force Claude 200k context when selected/(default)#2690

Open
lostf1sh wants to merge 1 commit into
pingdotgg:mainfrom
lostf1sh:main
Open

fix(server): force Claude 200k context when selected/(default)#2690
lostf1sh wants to merge 1 commit into
pingdotgg:mainfrom
lostf1sh:main

Conversation

@lostf1sh
Copy link
Copy Markdown

@lostf1sh lostf1sh commented May 14, 2026

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 :
image

After:
image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

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 contextWindow selection from provider option descriptors and injects/removes CLAUDE_CODE_DISABLE_1M_CONTEXT in the SDK env to 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 selecting 1m clears 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_CONTEXT by default

  • Adds resolveClaudeOneMillionContextDisabled in ClaudeAdapter.ts to check the contextWindow provider option: returns true (disable 1M) when the value is 200k or absent, and false when explicitly set to 1m.
  • Adds withClaudeContextWindowEnvironment to conditionally set or remove CLAUDE_CODE_DISABLE_1M_CONTEXT in the env passed to Claude queries.
  • When the user explicitly selects 1m context, the env variable is removed and [1m] is appended to the model name to override any process-level disable.
  • Behavioral Change: CLAUDE_CODE_DISABLE_1M_CONTEXT=1 is now injected by default (200k is the default context window), overriding any external env that had previously enabled 1M context silently.

Macroscope summarized acb6057.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2faaf2f8-7311-4fe4-ad6c-53ddd499ccdc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels May 14, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 14, 2026

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant