Skip to content

ACP: expose contextTier as a session config option (parity with interactive /model picker) #4275

Description

@julianmesa-gitkraken

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:

  1. Include a contextTier entry in the configOptions array returned by session/new (and session/load), of type: "select", with the eligible values for the current model (default, long_context) and the current value.
  2. Accept session/set_config_option with configId: "contextTier" and apply it to the live session, exactly as the /model picker does interactively.
  3. 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

  1. 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.
  2. A user on Claude Opus hits a large refactor mid-conversation and switches from default to long_context without losing session state — today the client must kill and respawn copilot --acp --context long_context and resume, or the control is simply hidden.
  3. A client drops back from long_context to default after the large task is done, to avoid the surcharge for the rest of the conversation.
  4. A client reads the current tier from session/load when 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

  1. added
    area:configuration
    area:non-interactive
    and removed on Jul 28, 2026
  2. xyzzer-msft commented on Aug 8, 2026

    @xyzzer-msft

    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.json was set to contextTier: "long_context" and model: "claude-opus-4.8", then a session was spawned with no flags and no set_config_option:

    persisted key honored by the ACP session?
    model: claude-opus-4.8 yes -- session came up on opus-4.8
    contextTier: long_context no -- session ran at the default window

    Same 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 into settings.json rather than applying only for that invocation, the same way --bash-env does. 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. newSession resolves and passes reasoningEffort, but there is no tier counterpart. Enumerating every resolveInitial* helper in the bundle gives resolveInitialReasoningEffort, resolveCliReasoningEffort, resolveInitialToolFilters -- and no resolveInitialContextTier. 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:

    async applySessionModel(e, n) {
      await e.session.model.switchTo({ modelId: n })
    }

    versus the interactive path, which deliberately carries the current tier across the switch:

    const $t = (await et.model.getCurrent()).contextTier;
    await et.model.switchTo({ modelId: Ze, ...($t !== void 0 ? { contextTier: $t } : {}) });

    Because an absent contextTier in ModelChangeData clears 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 one switchTo call 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_option for model would silently reset the tier to default.

    3. Not a recent regression

    applySessionModel is byte-identical in 1.0.69-0 and 1.0.78-2, resolveInitialContextTier is absent in both, and both advertise the same five config-option cases (mode, model, reasoning_effort, allow_all, agent, then default: 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:

    1. Add a resolveInitialContextTier alongside resolveInitialReasoningEffort and pass the result through newSession. That alone makes --context and the persisted setting work for ACP clients, which unblocks the main scenario without any protocol change.
    2. Make applySessionModel preserve the tier the way the interactive path does (read getCurrent().contextTier, spread it into switchTo). Without this, (1) is undone by the first model change.
    3. Then expose contextTier as a session/set_config_option id, 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 -- -p forwards slash commands to the model instead of intercepting them, so I could not exercise the interactive /model tier 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, newSession and the config-option dispatch table can all be read directly.

    (Posted by Copilot CLI on my behalf without human review)

  3. NSExceptional commented on Aug 15, 2026

    @NSExceptional

    I'm integrating copilot --acp into a fork of T3 Code. reasoning_effort works great as a live session/set_config_option, but because contextTier isn't in configOptions, 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 /context equivalent over ACP and --acp mode doesn't emit usage_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. Exposing contextTier in configOptions (with a currentValue) would close that too.

    Anyway, +1

  4. pank commented on Sep 2, 2026

    @pank

    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 configOptions as 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 way reasoningEffort already is: flag first, then settings.json):

    - newSession({ ..., reasoningEffort })
    + newSession({ ..., reasoningEffort, contextTier })

    Fix 2: switching models retains context size:

    - switchTo({ modelId })
    + switchTo({ modelId, contextTier: currentContextTier })
  5. maximuszeng commented on Oct 8, 2026

    @maximuszeng

    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:

    copilot --acp --context long_context --acp
    

    Persisted setting is also in place: contextTier=long_context in ~/.copilot/settings.json.

    Fresh ACP session, first turn, /context output:

    claude-opus-5.5 · 31k/200k tokens (16%)
    

    Denominator is 200k, not the long_context allowance (max_prompt_tokens: 1,000,000, max_context_window_tokens: 1,128,000 for claude-opus-5.5 per 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_context in its argv still runs at the default tier, by both the /context readback and the compaction behavior.

    The root-cause analysis by @xyzzer-msft above (no resolveInitialContextTier in the ACP bridge, plus applySessionModel clearing the tier) matches these symptoms exactly. Steps 1+2 of the suggested fix would unblock ACP clients like Paseo without any protocol change.

  6. vincent1114 commented on Oct 27, 2026

    @vincent1114

    Still reproducible on 1.0.103 (Windows), with a narrower root cause: --context long_context is honored for session/new, but any session/set_config_option on configId: "model" resets the tier to default — even when setting the same model that is already current.

    Raw ACP repro (copilot --acp --context long_context, no client MCP servers), checking the usage_update.size after a one-line prompt:

    Steps usage_update.size
    session/new → prompt 872000 (claude-sonnet-5.5, long tier ✅)
    session/new → set_config_option model=claude-sonnet-5.5 (unchanged) → prompt 200000 ❌
    session/new → set_config_option model=claude-opus-5.5 → prompt 200000 ❌
    --model claude-opus-5.5 + set_config_option model=claude-opus-5.5 → prompt 200000 ❌
    session/load of an existing session (no model set) 968000 (claude-opus-5.5) ✅

    Also tried, none restore the tier: set_config_option with configId context_tier/contextTier/context (all Unknown config option), session/set_model with _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 / persisted contextTier) when the new model supports it, plus the contextTier config option proposed above.

  7. 5078086729442496Mahmoud commented on Oct 27, 2026

    @5078086729442496Mahmoud
  8. uzairansaruzi commented on Oct 29, 2026

    @uzairansaruzi

    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, then session/set_config_option model=claude-opus-5.5 (unchanged), then one prompt:

    1 session.start         {"selectedModel":"claude-opus-5.5","contextTier":"long_context"}
    2 session.model_change  {"newModel":"claude-opus-5.5","previousModel":"claude-opus-5.5","contextTier":null,"source":"sdk"}
    6 session.usage_record  maxPromptTokens: 200000
    

    In the bundled copilot-sdk/generated:

    • ModelSwitchToRequest.reasoningEffort says "When omitted, the session's current effort is kept". contextTier makes no such promise.
    • ModelChangeData.contextTier says "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" in settings.json, sending /model -s claude-opus-5.5 as an ACP prompt logs a source: "model_command" change but doesn't restore the saved tier. usage_update.size stays at 200000.

    Preserving the current tier in the ACP model switch would fix this. The proposed contextTier config option would let clients set it. T3 Code is also tracking its side, skipping a model set that changes nothing: pingdotgg/t3code#27022.

  9. dengliu commented on Nov 15, 2026

    @dengliu

    Sharing a fresh 1.0.112 datapoint from integrating copilot --acp in OpenIDEA:

    1. Model-switch tier reset appears fixed in 1.0.112

    Probing copilot --acp (1.0.112, macOS arm64) and inspecting usage_update.size on the first prompt:

    Launch args Setup steps usage_update.size
    copilot --acp --no-auto-update session/new (claude-sonnet-5.5) → session/prompt 200000
    copilot --acp --no-auto-update session/new → session/set_config_option(model="gpt-6-sol") → session/prompt 272000
    copilot --acp --context long_context --no-auto-update session/new (claude-sonnet-5.5) → session/prompt 936000
    copilot --acp --context long_context --no-auto-update session/new → session/set_config_option(model="gpt-6-sol") → session/prompt 872000

    So in 1.0.112, --context long_context now survives session/set_config_option on model (and did not mutate ~/.copilot/settings.json).

    2. contextTier is still missing from ACP configOptions in 1.0.112

    session/new and session/load still advertise only ["mode", "model", "reasoning_effort", "allow_all"], so ACP IDE clients still cannot:

    • Discover whether the selected model is single-tier (e.g. gpt-5.3-codex) or tiered (default vs long_context),
    • Read the active context tier from session/new / session/load before a turn runs, or
    • Let users switch between default (200K / 272K) and long_context (1M / 500K) per session via session/set_config_option the way reasoning_effort already works (and the way VS Code Copilot / --headless session.model.switchTo already do).

    3. Small request on option metadata

    When exposing contextTier in configOptions, including each tier's resolved window size in name (e.g. "200K" / "1M", "272K" / "1M") or in _meta (e.g. maxPromptTokens / maxContextWindowTokens) — and updating contextTier.options in session/set_config_option's response when model changes — would let ACP IDEs render accurate per-model Context Size controls with zero hardcoded model tables.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationarea:non-interactive

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions