Describe the bug
When a model with a long-context tier (e.g., claude-opus-4.7-1m-internal with the 1M context tier) is selected via /model, the contextTier value is correctly persisted to ~/.copilot/settings.json as "contextTier": "long_context".
However, on subsequent CLI launches, the persisted contextTier is not restored. The model field is loaded correctly, but the session silently falls back to the default (smaller) context tier. The user must re-run /model and re-select the long-context tier every single session for it to take effect.
This defeats the persistence that the setting clearly intends to provide, and forces anyone relying on long-context models to remember a manual step every time they start the CLI.
Affected version
Copilot CLI v1.0.55-7 (macOS, darwin-arm64)
Steps to reproduce the behavior
- Launch the CLI and run
/model. Select a model with a long-context tier (e.g., claude-opus-4.7-1m-internal + 1M context).
- Confirm the CLI shows the tier indicator (e.g., "(1M context)") and that
~/.copilot/settings.json now contains both:
{
"model": "claude-opus-4.7-1m-internal",
"contextTier": "long_context"
}
- Run
/context and confirm the context window shows the long-context size (~1M tokens).
- Exit the CLI.
- Open a fresh terminal and launch a new session (
copilot).
- Run
/context again.
Expected behavior
The new session should restore both model and contextTier from ~/.copilot/settings.json. /context in the new session should show the long-context size (~1M tokens), matching what was shown before exit.
Actual: The model is restored correctly, but the tier reverts to the default. /context shows the smaller window:
○ ○ ○ ○ ○ ○ ○ ○ ○ ○ claude-opus-4.7-1m-internal · 53k/200k tokens (26%)
The only way to get the long-context tier back is to re-run /model and re-select it, every session.
Additional context
Root cause (from inspection of v1.0.55-7 app.js)
On session startup, the model is restored via:
this.session.setSelectedModel(l.model, c) // c = defaultReasoningEffort
Only model and reasoningEffort are passed. The contextTier field is loaded from settings elsewhere in the code (no.load(...)), but it is never threaded into this initial setSelectedModel call.
Inside applyModelChange, this.contextTier is only overwritten when the incoming argument is defined:
r?.contextTier !== void 0 && (this.contextTier = r.contextTier ?? void 0)
So when the startup call omits it, this.contextTier stays undefined and the session falls back to the default tier — regardless of what's on disk.
By contrast, when /model is used interactively, the picker explicitly passes contextTier to setSelectedModel(ne, nn, Ai, void 0, at) and to applyModelChange({ ..., contextTier: s }). That is why the tier works mid-session but not on launch.
Suggested fix
At the startup call site (where l = await no.load(settings) is consumed), pass l.contextTier as the 5th argument to setSelectedModel, mirroring what the /model flow already does.
Workarounds attempted (none viable)
- Manually editing
~/.copilot/settings.json to set "contextTier": "long_context" — value persists on disk but is ignored at startup.
- Environment variable override — none exists. The binary exposes
COPILOT_MODEL, COPILOT_MODEL_FAMILY, COPILOT_AGENT_MODEL, and a few provider overrides, but nothing for contextTier.
Impact
Anyone relying on long-context model variants (e.g., 1M context) has to remember to re-select the tier every session. This is especially painful for long sessions or for users who frequently start new sessions across multiple terminals.
Describe the bug
When a model with a long-context tier (e.g.,
claude-opus-4.7-1m-internalwith the 1M context tier) is selected via/model, thecontextTiervalue is correctly persisted to~/.copilot/settings.jsonas"contextTier": "long_context".However, on subsequent CLI launches, the persisted
contextTieris not restored. Themodelfield is loaded correctly, but the session silently falls back to the default (smaller) context tier. The user must re-run/modeland re-select the long-context tier every single session for it to take effect.This defeats the persistence that the setting clearly intends to provide, and forces anyone relying on long-context models to remember a manual step every time they start the CLI.
Affected version
Copilot CLI v1.0.55-7 (macOS, darwin-arm64)
Steps to reproduce the behavior
/model. Select a model with a long-context tier (e.g.,claude-opus-4.7-1m-internal+ 1M context).~/.copilot/settings.jsonnow contains both:{ "model": "claude-opus-4.7-1m-internal", "contextTier": "long_context" }/contextand confirm the context window shows the long-context size (~1M tokens).copilot)./contextagain.Expected behavior
The new session should restore both
modelandcontextTierfrom~/.copilot/settings.json./contextin the new session should show the long-context size (~1M tokens), matching what was shown before exit.Actual: The model is restored correctly, but the tier reverts to the default.
/contextshows the smaller window:The only way to get the long-context tier back is to re-run
/modeland re-select it, every session.Additional context
Root cause (from inspection of v1.0.55-7
app.js)On session startup, the model is restored via:
Only
modelandreasoningEffortare passed. ThecontextTierfield is loaded from settings elsewhere in the code (no.load(...)), but it is never threaded into this initialsetSelectedModelcall.Inside
applyModelChange,this.contextTieris only overwritten when the incoming argument is defined:So when the startup call omits it,
this.contextTierstaysundefinedand the session falls back to the default tier — regardless of what's on disk.By contrast, when
/modelis used interactively, the picker explicitly passescontextTiertosetSelectedModel(ne, nn, Ai, void 0, at)and toapplyModelChange({ ..., contextTier: s }). That is why the tier works mid-session but not on launch.Suggested fix
At the startup call site (where
l = await no.load(settings)is consumed), passl.contextTieras the 5th argument tosetSelectedModel, mirroring what the/modelflow already does.Workarounds attempted (none viable)
~/.copilot/settings.jsonto set"contextTier": "long_context"— value persists on disk but is ignored at startup.COPILOT_MODEL,COPILOT_MODEL_FAMILY,COPILOT_AGENT_MODEL, and a few provider overrides, but nothing forcontextTier.Impact
Anyone relying on long-context model variants (e.g., 1M context) has to remember to re-select the tier every session. This is especially painful for long sessions or for users who frequently start new sessions across multiple terminals.