github / github/copilot-cli

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

オープン
#4,275 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
area:configuration area:non-interactive
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### 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 `, 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 `. 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.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

既存の reasoning_effort ACP 設定オプションを前例として始め、続いて session/new と session/load の通知および処理、さらに session/set_config_option の処理を追跡します。これらの経路を、インタラクティブな /model ピッカーと --context の動作と比較します。対象となるモデルが現在の contextTier を公開し、クライアントがライブセッション中に再起動せず変更できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
shell
領域
api, cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
65/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。