[BUG] Desktop 5.11492.5 forces gateway Code sessions to 200K via --settings, overriding configured 1M
Preflight Checklist
- [x] Searched existing issues for
CLAUDE_CODE_MAX_CONTEXT_TOKENS, Desktop 200K limits, andmanagesProviderRouting. - [x] This report covers one regression: a new Desktop-supplied context-window override for gateway sessions.
- Version scope: Claude Desktop 5.11492.5 and its Desktop-managed Claude Code 2.1.325 runtime. The latest standalone CLI release was not independently verified.
What's Wrong?
After updating Claude Desktop on Windows to 5.11492.5, a Code-tab session using a custom model through a local Magpie gateway is limited to 200,000 tokens, despite an explicit 1,000,000-token setting in the user's Claude Code configuration and Desktop's Use 1M wherever it's available option being enabled.
The Desktop host supplies a --settings argument containing CLAUDE_CODE_MAX_CONTEXT_TOKENS=200000. The running session inherits that value and reports a 200K window. The new override is visible in the shipped Desktop JavaScript; the corresponding override was not found in the locally retained 5.11492.2 and 5.11492.0 bundles.
This appears to be a Desktop gateway-routing regression, rather than a limit imposed by Magpie or a missing model-picker entitlement.
What Should Happen?
For gateway/custom-model sessions, Desktop should honor an explicit, supported context-window configuration instead of unconditionally overriding it to 200K. A gateway whose backend supports 1M should be usable with a 1M client window while retaining normal compaction.
If a smaller cap is intentional, it should be documented and surfaced to the user, with an appropriate supported way to select the backend's actual capacity.
Environment
- Claude Desktop: 5.11492.5; Windows MSIX package version 5.11492.5.0, x64.
- Desktop-managed Claude Code: 2.1.325.
- OS: Windows 11, build 26300.
- Surface: Desktop Code tab, local session.
- Platform: Other — a local Magpie gateway exposed through
ANTHROPIC_BASE_URL. - Model: an opaque custom gateway model ID, with no
[1m]suffix. Its name is not evidence of the upstream model identity. modelPrefer1mContext: true in the Desktop connection configuration.CLAUDE_CODE_DISABLE_1M_CONTEXT: unset in the observed session and user settings.- No application bundle, executable, or configuration was modified during diagnosis.
Steps to Reproduce
-
Configure Desktop to use a gateway and a custom model ID.
-
Enable Use 1M wherever it's available for the connection.
-
In
~/.claude/settings.json, explicitly configure the intended window:{ "env": { "CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000", "CLAUDE_CODE_AUTO_COMPACT_WINDOW": "1000000" } } -
On Desktop 5.11492.5, start a local Code-tab session using that custom model.
-
Inspect the Desktop-launched CLI command line: its
--settingsJSON suppliesenv.CLAUDE_CODE_MAX_CONTEXT_TOKENS="200000". -
Inspect a shell child launched by that session:
CLAUDE_CODE_MAX_CONTEXT_TOKENSis200000, even though the same process can read1000000from the settings file. -
Inspect the session's context usage:
contextWindowis200000.
CLAUDE_CODE_AUTO_COMPACT_WINDOW is included to describe the observed configuration, not as a proposed way to increase the model's context window.
Observed Runtime Evidence
| Source | Value |
|---|---|
User settings.json: env.CLAUDE_CODE_MAX_CONTEXT_TOKENS |
1000000 |
Desktop connection: modelPrefer1mContext |
true |
Desktop-launched CLI --settings: env.CLAUDE_CODE_MAX_CONTEXT_TOKENS |
200000 |
| Session child-process environment | 200000 |
| Desktop session context-usage result | "contextWindow": 200000 |
The relevant host-supplied settings value is:
{
"env": {
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "200000"
}
}
Other unrelated command-line settings have been omitted. Full command lines, authentication material, and conversation logs are intentionally not attached.
Shipped Code / Regression Evidence
In 5.11492.5, app.asar entry .vite/build/index.chunk-DL8fZzVo.js contains the following logic. This excerpt is reformatted; unrelated object fields are omitted:
var uln = 2e5;
function fln(e, t, n) {
let r = lln(e, t), i = {
...t.managesProviderRouting && {
env: {
CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(uln)
}
},
// Unrelated object fields omitted.
};
return Object.keys(i).length > 0 ? i : void 0;
}
The third-party implementation returns true from managesProviderRouting(). Wso() invokes fln() when constructing host-supplied settings. This agrees with both the observed --settings value and the session's process environment.
Read-only comparison of locally retained Windows Desktop bundles:
| Desktop version | Matching unconditional 200K gateway startup override |
|---|---|
| 5.11492.5 | Present: 2e5 is supplied as CLAUDE_CODE_MAX_CONTEXT_TOKENS when managesProviderRouting is true |
| 5.11492.2 | No matching override found |
| 5.11492.0 | No matching override found |
The older versions still contain the separate conditional model-window assignment that only fills in CLAUDE_CODE_MAX_CONTEXT_TOKENS when it is unset. Their locally retained executables have valid Authenticode signatures.
Verification boundary: this is a static comparison of the retained older bundles, not a claim that a runtime downgrade has already been tested. The reporter observed the problem after the Desktop update. No large-context inference request was sent to prove the backend's actual 1M acceptance limit; this report concerns the independently observable client-side override.
Is this a regression?
Yes — the observed behavior appeared after the Desktop update, and the unconditional override is present in 5.11492.5 but absent from the retained 5.11492.2 and 5.11492.0 bundles. Runtime rollback verification is pending.
Last Working Version
5.11492.2 is the nearest prior bundle without this override. A runtime downgrade has not yet been verified.
Related Reports
- https://github.com/anthropics/claude-code/issues/106120 — first-party Desktop model-picker / 1M selection issue. This report instead concerns gateway routing and an explicit
--settingsenvironment override. - https://github.com/anthropics/claude-code/issues/87550 — earlier Desktop bare-model-ID / missing
[1m]issue. This report identifies a new unconditional numeric cap in Desktop 5.11492.5.
Additional independent macOS reproduction (2026-11-17, China Standard Time):
- macOS 26.5 (arm64), Claude Desktop 5.11492.5, Magpie 0.1.4358. The affected surface is Desktop's local Code tab in third-party gateway mode, using
dcs/deepseek-flash-v4.1. - The Code UI shows
27.1k / 200k (14%). The user reports that this setup previously showed a 512k context window and changed to 200k today. - Magpie still has
providers.json -> dcs.contexts["*"] = 512000andsettings.json -> agentContexts["claude-desktop"]["*"] = 512000. The user~/.claude/settings.jsonstill hasenv.CLAUDE_CODE_MAX_CONTEXT_TOKENS = "512000"andmodelSettingsfor the Desktop's opaquemythos-magpie-<n>IDs withautoCompactWindow = 500000. - Current Desktop session metadata reports Claude Code
2.1.325with entrypointclaude-desktop-3p. The separately installed terminal CLI is2.1.322; that is not the runtime used by this Desktop session. - Read-only inspection of this macOS
/Applications/Claude.app/Contents/Resources/app.asarfound the same host logic:var Fcn=2e5and, whenmanagesProviderRoutingis true,env:{CLAUDE_CODE_MAX_CONTEXT_TOKENS:String(Fcn)}.
This extends the report's platform coverage from Windows to macOS. The UI result and shipped host code agree with the 200k override described here. I did not inspect the live child process's --settings/environment or send a >200k request, so this observation does not establish the upstream model's actual capacity. No configuration or application files were changed.
Independent macOS confirmation, including the live Desktop startup arguments.
On Claude Desktop 5.11492.5, a local Code session using an opaque gateway model ID without a [1m] suffix shows the same mismatch:
| Evidence | Observed value |
|---|---|
User configuration: env.CLAUDE_CODE_MAX_CONTEXT_TOKENS |
1048576 |
Per-model autoCompactWindow for the selected gateway model |
480000 |
Desktop-launched session: --settings contains env.CLAUDE_CODE_MAX_CONTEXT_TOKENS |
"200000" |
The affected live session was matched to the selected gateway model; this is not just an inspection of generated configuration files. Its retained transcript also contains automatic compaction events at approximately 167K-173K tokens. Those events are consistent with a 200K window, although they are not a direct readback of contextWindow.
Read-only inspection of the installed macOS bundle also found the corresponding host code:
// Excerpt from the shipped bundle; unrelated fields omitted.
var Fcn = 2e5;
// Inside the host-supplied settings construction:
...t.managesProviderRouting && {
env: {
CLAUDE_CODE_MAX_CONTEXT_TOKENS: String(Fcn)
}
}
This corroborates the reported override on macOS as well as Windows.
Suggested fix direction: avoid unconditionally replacing an explicitly configured, supported context window with 200K. Preserve a safe default when no window is configured, and retain per-model compaction limits so switching to a smaller-window model does not overshoot its capacity.
Useful acceptance checks would be:
- Start a new Desktop gateway session and verify the effective startup settings and reported context window.
- Confirm proactive auto-compaction remains enabled.
- Switch between models with different supported windows and verify the applicable budget.
- Do not require falsely declaring 1M capability or mapping a non-Claude backend to a Claude model identity.
Verification boundary: no application or configuration files were modified, no large-context inference probe was sent, and the configured values above are not proof of backend capacity. Full process arguments, identifiers, paths, and conversation contents are omitted.