Repository navigation
Description
Describe the feature or problem you'd like to solve
The interactive CLI lets you change the context window tier mid-session (via the /model context tier picker), but the ACP server does not expose contextTier as a session config option. ACP clients can only set the tier at spawn time with --context <tier>, and have no way to discover or change it once the session is running.
Proposed solution
Expose the context tier over ACP with the same shape already used for reasoning_effort:
- Include a
contextTierentry in theconfigOptionsarray returned bysession/new(andsession/load), oftype: "select", with the eligible values for the current model (default,long_context) and the current value. - Accept
session/set_config_optionwithconfigId: "contextTier"and apply it to the live session, exactly as the/modelpicker does interactively. - Only advertise the option for tiered-pricing models, mirroring the interactive behaviour ("context tier picker appears for eligible models").
This closes a parity gap rather than adding new functionality: the capability already exists in the runtime and is reachable from the interactive UI and from settings.json; it is just not reachable through ACP.
Issue #1994 ("Allow reasoning effort discovery and setting via ACP") is the direct precedent — reasoning_effort is now a first-class ACP config option, and contextTier is the remaining sibling setting that isn't.
Example prompts or workflows
- An ACP client (Zed, or any ACP editor integration) shows a "Context Size" picker next to the model and reasoning-effort pickers, populated from
session/new, instead of having to hardcode the tier list per CLI version. - A user on Claude Opus hits a large refactor mid-conversation and switches from
defaulttolong_contextwithout losing session state — today the client must kill and respawncopilot --acp --context long_contextand resume, or the control is simply hidden. - A client drops back from
long_contexttodefaultafter the large task is done, to avoid the surcharge for the rest of the conversation. - A client reads the current tier from
session/loadwhen reconnecting to an existing session, so the UI reflects reality instead of guessing.
Additional context
Reproduced against GitHub Copilot CLI 1.0.75.
The interactive CLI supports hot changes — from copilot help config:
contextTier: context window tier for tiered-pricing models (e.g., "default" or "long_context").
- Can also be set with --context flag (overrides persisted setting)
- Can be changed with /model command (context tier picker appears for eligible models)
ACP does not. Minimal probe over copilot --acp (initialize → session/new → session/set_config_option):
configOptions ids: ["mode","model","reasoning_effort","allow_all"]
contextTier -> {"code":-32602,"message":"Unknown config option 'contextTier'."}
context -> {"code":-32602,"message":"Unknown config option 'context'."}
contextSize -> {"code":-32602,"message":"Unknown config option 'contextSize'."}
So reasoning_effort is exposed but contextTier is not, even though both are per-session model settings adjustable from the interactive /model flow.
Current workaround and why it's poor. The tier can only be pinned at spawn time via --context <tier>. Changing it for a running conversation requires terminating the agent process and respawning it with a different flag, then reloading the session — an intrusive lifecycle operation for what is a per-request setting, and one that ACP clients cannot make feel like the interactive picker.
Activity
xyzzer-msft commentedon Aug 8, 2026
Some additional data on this one, from reading the CLI's own bundled JS rather than probing it from outside. Two corrections to the issue body, plus a root cause.
1. The stated workaround does not actually work
The issue body says ACP clients "can only set the tier at spawn time with
--context <tier>". That turns out not to hold -- there is no way to get a non-default tier into an ACP session at all, including at spawn time.Measured with a controlled experiment.
settings.jsonwas set tocontextTier: "long_context"andmodel: "claude-opus-4.8", then a session was spawned with no flags and noset_config_option:model: claude-opus-4.8contextTier: long_contextSame file, same read path, one key honored and the other dropped. So this is not "settings.json is ignored in ACP mode"; it is specifically the tier that is dropped.
(Worth flagging separately for anyone probing this:
--context <tier>writes the preference intosettings.jsonrather than applying only for that invocation, the same way--bash-envdoes. So probing with the flag silently mutates the user's config and contaminates any later "clean baseline" run. That cost me a run before I noticed.)2. Root cause: two dropped parameters in the ACP bridge
This is not a gated or unimplemented feature -- the runtime capability is fully present and the interactive path uses it. The ACP bridge just never passes the parameter, in two independent places.
(a) Session creation never resolves a tier.
newSessionresolves and passesreasoningEffort, but there is no tier counterpart. Enumerating everyresolveInitial*helper in the bundle givesresolveInitialReasoningEffort,resolveCliReasoningEffort,resolveInitialToolFilters-- and noresolveInitialContextTier. Nothing reads the persisted or flag-supplied tier on the ACP path, which is why (1) above happens.(b) Model changes actively clear the tier. The ACP handler:
versus the interactive path, which deliberately carries the current tier across the switch:
Because an absent
contextTierinModelChangeDataclears a previous selection rather than leaving it alone, the ACP version doesn't merely fail to set the tier -- it wipes it on every model change. There is exactly oneswitchTocall in the ACP class (the lossy one); all four tier-preserving calls are in the interactive startup path.So even if (a) were fixed, any subsequent
set_config_optionformodelwould silently reset the tier to default.3. Not a recent regression
applySessionModelis byte-identical in 1.0.69-0 and 1.0.78-2,resolveInitialContextTieris absent in both, and both advertise the same five config-option cases (mode,model,reasoning_effort,allow_all,agent, thendefault: throw Unknown config option). Unchanged across at least nine patch releases.4. Suggested shape of the fix
Both halves are small and mirror code that already exists:
resolveInitialContextTieralongsideresolveInitialReasoningEffortand pass the result throughnewSession. That alone makes--contextand the persisted setting work for ACP clients, which unblocks the main scenario without any protocol change.applySessionModelpreserve the tier the way the interactive path does (readgetCurrent().contextTier, spread it intoswitchTo). Without this, (1) is undone by the first model change.contextTieras asession/set_config_optionid, as originally requested, for hot switching.Steps 1 and 2 are worth doing even if 3 is not prioritized -- as it stands, an ACP client cannot reach the tier by any route, and step 2 is arguably a standalone bug independent of this feature request.
Caveat
I was only ever able to drive the CLI headlessly through ACP --
-pforwards slash commands to the model instead of intercepting them, so I could not exercise the interactive/modeltier picker in an automated way. I can demonstrate that the ACP path drops the tier; I have not independently verified that the interactive path honors it end to end, beyond the code above showing that it plumbs the parameter.Analysis was done against the CLI's own bundled JS: the SEA payload is a gzip stream inside the binary that inflates to the readable bundle, so
applySessionModel,newSessionand the config-option dispatch table can all be read directly.(Posted by Copilot CLI on my behalf without human review)
NSExceptional commentedon Aug 15, 2026
I'm integrating
copilot --acpinto a fork of T3 Code.reasoning_effortworks great as a livesession/set_config_option, but becausecontextTierisn't inconfigOptions, the only external lever we have is--context <tier>, which as someone else pointed out, probably doesn't even work.One adjacent point: a readback path would help clients confirm the tier actually applied. Right now there's no
/contextequivalent over ACP and--acpmode doesn't emitusage_update(#4233), and long-context-at-startup has had reliability issues (#3481) — so an ACP client currently sets the tier blind, with no way to verify it took effect. ExposingcontextTierinconfigOptions(with acurrentValue) would close that too.Anyway, +1
pank commentedon Sep 2, 2026
I found two small fixes for this (using copilot-cli itself). The first fix makes a new ACP session optionally start with a large context. The second fix keeps that large context after switching models mid-session, instead of resetting it to the small default. It would be great to fix this as I always use copilot-cli through
agent-shell.It would be great to expose it as a
configOptionsas well, as @NSExceptional and others mention.The fixes seems to work based on a very brief test (I have not actually used it beyond a brief test so take it with a grain of salt).
Fix 1: new sessions respect
--context(resolved the same wayreasoningEffortalready is: flag first, thensettings.json):Fix 2: switching models retains context size:
maximuszeng commentedon Oct 8, 2026
Confirmed still broken on 1.0.93 (2026-10-07) — the changelog entry "Honor --context long_context at startup and show accurate context allowance in /context" appears to cover the interactive path only; the ACP path still drops the tier.
Repro (Paseo as ACP client)
Spawn command, verified in the live process args:
Persisted setting is also in place:
contextTier=long_contextin~/.copilot/settings.json.Fresh ACP session, first turn,
/contextoutput:Denominator is 200k, not the long_context allowance (
max_prompt_tokens: 1,000,000,max_context_window_tokens: 1,128,000forclaude-opus-5.5per the model metadata the CLI itself fetches).Behavioral confirmation
Tasked the ACP session with reading a ~214k-token file in ~4k-token pages. Auto-compaction kicked in at ~40k tokens of file content (~70k total context incl. system prompt/tools) — silent history compression, no error surfaced. The agent gave up at ~640 of 1682 lines, correctly concluding the window could not hold the file.
With a 1M window, 214k tokens would have fit without any compaction.
Note on scope
I could not end-to-end verify the interactive path headlessly (the TUI's terminal probes make pty automation unreliable), so I can't confirm where the 1.0.93 startup fix landed. What I can state from direct observation: an ACP-spawned 1.0.93 session with
--context long_contextin its argv still runs at the default tier, by both the/contextreadback and the compaction behavior.The root-cause analysis by @xyzzer-msft above (no
resolveInitialContextTierin the ACP bridge, plusapplySessionModelclearing the tier) matches these symptoms exactly. Steps 1+2 of the suggested fix would unblock ACP clients like Paseo without any protocol change.vincent1114 commentedon Oct 27, 2026
Still reproducible on 1.0.103 (Windows), with a narrower root cause:
--context long_contextis honored forsession/new, but anysession/set_config_optiononconfigId: "model"resets the tier todefault— even when setting the same model that is already current.Raw ACP repro (
copilot --acp --context long_context, no client MCP servers), checking theusage_update.sizeafter a one-line prompt:usage_update.sizesession/new→ promptsession/new→set_config_option model=claude-sonnet-5.5(unchanged) → promptsession/new→set_config_option model=claude-opus-5.5→ prompt--model claude-opus-5.5+set_config_option model=claude-opus-5.5→ promptsession/loadof an existing session (no model set)Also tried, none restore the tier:
set_config_optionwithconfigIdcontext_tier/contextTier/context(allUnknown config option),session/set_modelwith_meta, and prompting/model claude-opus-5.5 --context long_context(Unexpected argument "--context").Impact: ACP clients that always apply the user's model selection on a new session (e.g. T3 Code) never get the long tier for new threads, only for resumed ones. With a large MCP/skill footprint (~150k static tokens here), the 200k default leaves little room for user input.
Expected: a model change should preserve the requested tier (
--context/ persistedcontextTier) when the new model supports it, plus thecontextTierconfig option proposed above.5078086729442496Mahmoud commentedon Oct 27, 2026
uzairansaruzi commentedon Oct 29, 2026
Note
🤖 Claude Opus 5.5 responding on behalf of uzairansaruzi
Still reproducible on 1.0.104 (macOS). The tier reset on model change is visible in the session journal, and Copilot's own SDK types back it up.
copilot --acp --model claude-opus-5.5 --context long_context, thensession/set_config_option model=claude-opus-5.5(unchanged), then one prompt:In the bundled
copilot-sdk/generated:ModelSwitchToRequest.reasoningEffortsays "When omitted, the session's current effort is kept".contextTiermakes no such promise.ModelChangeData.contextTiersays "null explicitly clears a previously selected tier".So an ACP model switch that omits the tier wipes it. Reasoning effort survives the same call.
One more path that doesn't work: with
"contextTier": "long_context"insettings.json, sending/model -s claude-opus-5.5as an ACP prompt logs asource: "model_command"change but doesn't restore the saved tier.usage_update.sizestays at 200000.Preserving the current tier in the ACP model switch would fix this. The proposed
contextTierconfig option would let clients set it. T3 Code is also tracking its side, skipping a model set that changes nothing: pingdotgg/t3code#27022.fix(acp): keep Copilot context tiers across startup notices and model…
dengliu commentedon Nov 15, 2026
Sharing a fresh 1.0.112 datapoint from integrating
copilot --acpin OpenIDEA:1. Model-switch tier reset appears fixed in
1.0.112Probing
copilot --acp(1.0.112, macOS arm64) and inspectingusage_update.sizeon the first prompt:usage_update.sizecopilot --acp --no-auto-updatesession/new(claude-sonnet-5.5) →session/prompt200000copilot --acp --no-auto-updatesession/new→session/set_config_option(model="gpt-6-sol")→session/prompt272000copilot --acp --context long_context --no-auto-updatesession/new(claude-sonnet-5.5) →session/prompt936000copilot --acp --context long_context --no-auto-updatesession/new→session/set_config_option(model="gpt-6-sol")→session/prompt872000So in
1.0.112,--context long_contextnow survivessession/set_config_optiononmodel(and did not mutate~/.copilot/settings.json).2.
contextTieris still missing from ACPconfigOptionsin1.0.112session/newandsession/loadstill advertise only["mode", "model", "reasoning_effort", "allow_all"], so ACP IDE clients still cannot:gpt-5.3-codex) or tiered (defaultvslong_context),session/new/session/loadbefore a turn runs, ordefault(200K/272K) andlong_context(1M/500K) per session viasession/set_config_optionthe wayreasoning_effortalready works (and the way VS Code Copilot /--headlesssession.model.switchToalready do).3. Small request on option metadata
When exposing
contextTierinconfigOptions, including each tier's resolved window size inname(e.g."200K"/"1M","272K"/"1M") or in_meta(e.g.maxPromptTokens/maxContextWindowTokens) — and updatingcontextTier.optionsinsession/set_config_option's response whenmodelchanges — would let ACP IDEs render accurate per-modelContext Sizecontrols with zero hardcoded model tables.