github / github/copilot-cli

ACP mode does not advertise session.fork capability (slash /fork exists; ACP method missing)

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

説明

## Summary

The Copilot CLI's ACP mode (`agency copilot --acp`, wrapping copilot 1.0.45) does **not** advertise a `fork` capability in its `InitializeResponse.agentCapabilities.sessionCapabilities`, even though the v1.0.45 PTY UI does ship a working `/fork` slash command (release notes; #3252).

This blocks ACP-only clients from using the SDK's `unstable_forkSession()` to do things like generate summaries off a fork without polluting the original session.

## Probe result

Sending an `initialize` JSON-RPC over stdio:

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}}}' \
| agency copilot --acp
```

returns:

```json
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": 1,
"agentCapabilities": {
"loadSession": true,
"mcpCapabilities": { "http": true, "sse": true },
"promptCapabilities": { "image": true, "audio": false, "embeddedContext": true },
"sessionCapabilities": { "list": {} }
},
"agentInfo": { "name": "Copilot", "title": "Copilot", "version": "1.0.45" },
...
}
}
```

`sessionCapabilities` only contains `list`. No `fork`.

## Why we want it

Downstream context: [copilot-ide](https://github.com/shachaf-ashkenazi/copilot-ide) generates session summaries by shelling out to `agency copilot -p "..."`, which spawns a one-shot session, gets a response, and exits. We then have to:

- Snapshot `~/.copilot/session-state/` before the spawn
- Diff after to find the scratch session(s) the CLI created
- `rm -rf` them so they don't pollute the user's SessionList

That's ~60 lines of cleanup ceremony in `summaryService.ts` plus a `SCRATCH_PREFIXES` filter elsewhere. With `session.fork` exposed in ACP, the entire dance collapses to:

```
forkSession(originalId) → connection.prompt(...) → collect chunks → closeSession()
```

— no on-disk pollution, no snapshot/diff, no scratch sessions ever appearing in the user's list.

The SDK side already has it: `@agentclientprotocol/sdk` v0.21.0 ships `unstable_forkSession()` documented as "allowing operations like generating summaries without affecting the original session's history." We just need the agent (Copilot CLI) to advertise the capability and respond to the corresponding ACP method.

## Ask

1. Add `fork` to `sessionCapabilities` in the ACP `InitializeResponse` (and implement the corresponding `session.fork` / `session/fork` ACP method, following the SDK's `unstable_forkSession` shape).
2. If there's a stability/timeline concern (the SDK still flags it `unstable_`), it'd be useful to know what's blocking stabilization.
3. Confirm whether the existing v1.0.45 `/fork` slash command can be wired to the same backend, or whether the ACP path needs a separate implementation.

## Environment

- agency 2026.5.11.1 (wrapping Copilot CLI 1.0.45)
- @agentclientprotocol/sdk 0.21.0
- macOS (aarch64)

## Related

- Internal slash command: github/copilot-cli#3252 (`/fork` shipped in v1.0.45)
- Downstream tracker: shachaf-ashkenazi/copilot-ide#37
- SDK audit that surfaced this: shachaf-ashkenazi/copilot-ide#32

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

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

評価

この issue はまだ評価されていません。

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

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