Skip to content

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

@shachaf-ashkenazi

Description

@shachaf-ashkenazi

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:

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

returns:

{
  "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 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: No /fork in v1.0.45 #3252 (/fork shipped in v1.0.45)
  • Downstream tracker: shachaf-ashkenazi/copilot-ide#37
  • SDK audit that surfaced this: shachaf-ashkenazi/copilot-ide#32

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automationarea:sessionsSession management, resume, history, session picker, and session state
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions