Skip to content

ACP mode does not implement session/close — ACP clients cannot release sessions #4113

Description

@DDKinger

Summary

When Copilot CLI runs as an ACP agent (copilot --acp --stdio), it does not
implement the ACP session/close request, and its initialize response does
not advertise the sessionCapabilities.close capability. As a result an ACP
client has no protocol-level way to tell Copilot that a session it created
via session/new is finished and can be torn down.

For a client that multiplexes many sessions over a single long-lived
copilot --acp process, every session ever created stays resident for the
lifetime of the Copilot process. session/cancel only aborts the in-flight
turn — it does not release the session — so there is no clean way to reclaim
per-session resources short of killing the whole agent process.

Environment

  • GitHub Copilot CLI 1.0.71-0
  • Transport: copilot --acp --stdio

Reproduction

Minimal repro with any ndjson JSON-RPC driver over copilot --acp --stdio:

  1. Send initialize { "protocolVersion": 1, "clientCapabilities": {} }
    note sessionCapabilities has no close.
  2. Send session/new { "cwd": "<abs path>", "mcpServers": [] } → capture
    sessionId.
  3. Send session/close { "sessionId": "<id>" } → observe
    -32601 "Method not found": session/close.

Expected behavior

  • Copilot CLI should advertise sessionCapabilities.close and implement
    session/close, allowing ACP clients to release an individual live session
    without terminating the shared Copilot process.

  • Closing a session should free its in-memory resources while preserving its
    persisted transcript so it can be resumed later via session/load.

Why this matters

ACP was designed for a client to own the process lifetime while opening and
closing many sessions against it. Without session/close:

  • No per-session teardown → unbounded growth: clients can only
    session/cancel  (turn abort) or kill the entire process; there is no way to release a
    single finished session. As a result, a long-lived host accumulates every session
    it ever created for the whole process lifetime, with no bounded-lifetime path and
    no way to reclaim resources without tearing down every other session sharing that process.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:sessionsSession management, resume, history, session picker, and session state

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions