acp-evidence-1784403354951.log
Describe the feature or problem you'd like to solve
The ACP server (copilot --acp --stdio / --port) does not expose any token usage, context consumption, or cost information anywhere in the protocol — not in the initialize response, not in session/update notifications, and not in the final session/prompt result. This makes it impossible for any ACP client (IDE integration, CI/CD orchestration, cost-monitoring tooling) to track how much a session consumed, which matters especially for CI/CD use cases, since ACP is explicitly listed as a supported use case for "orchestrating agentic coding tasks in automated workflows."
Proposed solution
Surface token/context usage as part of the ACP protocol, for example:
An additional field in the session/prompt result (e.g. usage: { inputTokens, outputTokens }), similar to how other agent protocols report usage per turn.
And/or a dedicated session/update notification (or a _meta extension field on existing updates) reporting cumulative usage per session, so long-running sessions can be monitored incrementally rather than only at the end.
Example prompts or workflows
- Running an ACP session inside a CI/CD job and failing the build if a step exceeds a token budget.
- An IDE (e.g. Zed) showing a live token/cost meter next to the agent panel during an ACP session.
- A cost-monitoring dashboard aggregating token consumption across multiple concurrent ACP sessions.
- A multi-agent orchestrator comparing cost across turns/agents to decide whether to continue or stop a task.
- Engineering leads attributing Copilot CLI cost per repository/per CI job when it's invoked via ACP in automated workflows.
Additional context
I ran a full session end-to-end (initialize → session/new → session/prompt → final response) and inspected every single raw NDJSON message exchanged (176 messages total). None of them contain any field related to token, usage, cost, credit, billing, or quota. The final result of session/prompt is simply:
{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn"}}
For comparison, this isn't a hypothetical ask — community ACP bridges for other agents already do this:
- codex-acp (both cola-io/codex-acp and the agentclientprotocol/codex-acp org package) explicitly lists token usage as one of the event types it maps into ACP session/update notifications, sourced from Codex's own EventMsg::TokenCount events.
- The acp-adapter project (bridging both Codex and Claude Code to ACP) maps a thread/tokenUsage/updated event from the underlying CLI into the ACP session stream.
In both cases, the underlying CLI already tracks token usage internally, and the ACP bridge simply forwards it. Copilot CLI's ACP server is implemented natively (not as a third-party bridge), so there's no external translation layer blocking this.
Copilot CLI version at time of testing: 1.0.72-1 (from the initialize response's agentInfo)
ACP protocol version: 1
Reproduction: copilot --acp --stdio, send initialize → session/new → session/prompt, capture and inspect every raw NDJSON line exchanged.
Related: #2947 ("Enable token usage to be reported in CLI for any session") — same underlying gap, different surface (ACP vs. interactive CLI).
acp-evidence-1784403354951.log
Describe the feature or problem you'd like to solve
The ACP server (copilot --acp --stdio / --port) does not expose any token usage, context consumption, or cost information anywhere in the protocol — not in the initialize response, not in session/update notifications, and not in the final session/prompt result. This makes it impossible for any ACP client (IDE integration, CI/CD orchestration, cost-monitoring tooling) to track how much a session consumed, which matters especially for CI/CD use cases, since ACP is explicitly listed as a supported use case for "orchestrating agentic coding tasks in automated workflows."
Proposed solution
Surface token/context usage as part of the ACP protocol, for example:
An additional field in the session/prompt result (e.g. usage: { inputTokens, outputTokens }), similar to how other agent protocols report usage per turn.
And/or a dedicated session/update notification (or a _meta extension field on existing updates) reporting cumulative usage per session, so long-running sessions can be monitored incrementally rather than only at the end.
Example prompts or workflows
Additional context
I ran a full session end-to-end (initialize → session/new → session/prompt → final response) and inspected every single raw NDJSON message exchanged (176 messages total). None of them contain any field related to token, usage, cost, credit, billing, or quota. The final result of session/prompt is simply:
{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn"}}For comparison, this isn't a hypothetical ask — community ACP bridges for other agents already do this:
In both cases, the underlying CLI already tracks token usage internally, and the ACP bridge simply forwards it. Copilot CLI's ACP server is implemented natively (not as a third-party bridge), so there's no external translation layer blocking this.
Copilot CLI version at time of testing: 1.0.72-1 (from the initialize response's agentInfo)
ACP protocol version: 1
Reproduction: copilot --acp --stdio, send initialize → session/new → session/prompt, capture and inspect every raw NDJSON line exchanged.
Related: #2947 ("Enable token usage to be reported in CLI for any session") — same underlying gap, different surface (ACP vs. interactive CLI).