You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ACP] Emit usage_update in --acp mode (context window + AI credits) for parity with the interactive statusline #4233
Describe the feature or problem you'd like to solve
copilot --acp never emits the ACP usage_update session update, so ACP clients (Zed, etc.) can't show a context-window or AI-credit usage indicator for Copilot — even though the CLI already computes this data for /context, /usage, and the statusline.
Proposed solution
Summary
When Copilot CLI runs in ACP mode (copilot --acp), it never sends the ACP session/update notification with sessionUpdate: "usage_update". As a result,
ACP clients (Zed and other editors/tools integrating over ACP) cannot show a
context‑window usage indicator or AI‑credit usage for Copilot — even though the
CLI already computes this data and surfaces it in interactive mode.
The gap: interactive mode has it, ACP mode doesn't
In interactive mode the data is already there:
The experimental statusLine.command receives JSON with context_window.current_context_tokens, context_window.displayed_context_limit, context_window.current_context_used_percentage, etc.
/context shows the context‑window breakdown.
/usage shows AI credits used in the current session.
But in --acp mode none of it is forwarded — the client only ever receives agent_message_chunk, tool_call, available_commands_update, etc., and never a usage_update (even though the type is part of the ACP schema the CLI already speaks).
For long agentic sessions, knowing how close you are to compaction — and how many
credits you've spent — is valuable.
Request
In --acp mode, emit session/update with sessionUpdate: "usage_update":
After session/new, session/load, session/resume, and after each prompt turn.
Populate the standard fields: used (current context tokens), size (context
window size), and cost (session cost) when available.
For AI credits (used / remaining) — which have no standard ACP field — attach them
via the update's _meta (already part of the usage_update schema), e.g. _meta: { ai_credits_used, ai_credits_remaining }.
This brings ACP mode to parity with the interactive statusline / /context / /usage, with no new data to compute — just forwarding what already exists over the
protocol the CLI already implements.
Independent confirmation of the gap, plus a data point that this affects more than one ACP client.
We probed copilot --acp --stdio (1.0.75) over a full turn on 2026-07-25 — initialize → session/new → session/prompt → stopReason: end_turn — and observed only agent_message_chunk, agent_thought_chunk, available_commands_update and session_info_update. No usage_update, and no usage field on any frame including the session/prompt response. Matches what's described here.
Two things worth adding:
This isn't Zed-specific. We're a separate ACP client (Kurrent Capacitor, which records and visualizes coding-agent sessions) and hit the identical wall. So the FR unblocks at least two independent consumers.
Client-side work is already done, at least on our end. We shipped the ingestion path for usage_update this week, deliberately dormant — keyed on the ACP spec rather than on any one vendor. The moment Copilot CLI emits {used, size}, our context indicator renders with no further change on our side and no release coupling. So the cost of this FR is genuinely one-sided: whatever it takes to forward data the CLI already computes.
For what it's worth, cursor-agent acp (2026.07.23) has the same gap — probed identically, same result. The Session Usage RFD is Completed but appears to be unimplemented across most agent CLIs, so whoever ships it first sets the practical precedent.
Happy to re-test against a build if that's useful.
Describe the feature or problem you'd like to solve
copilot --acpnever emits the ACPusage_updatesession update, so ACP clients (Zed, etc.) can't show a context-window or AI-credit usage indicator for Copilot — even though the CLI already computes this data for/context,/usage, and the statusline.Proposed solution
Summary
When Copilot CLI runs in ACP mode (
copilot --acp), it never sends the ACPsession/updatenotification withsessionUpdate: "usage_update". As a result,ACP clients (Zed and other editors/tools integrating over ACP) cannot show a
context‑window usage indicator or AI‑credit usage for Copilot — even though the
CLI already computes this data and surfaces it in interactive mode.
The gap: interactive mode has it, ACP mode doesn't
In interactive mode the data is already there:
statusLine.commandreceives JSON withcontext_window.current_context_tokens,context_window.displayed_context_limit,context_window.current_context_used_percentage, etc./contextshows the context‑window breakdown./usageshows AI credits used in the current session.But in
--acpmode none of it is forwarded — the client only ever receivesagent_message_chunk,tool_call,available_commands_update, etc., and never ausage_update(even though the type is part of the ACP schema the CLI already speaks).Why it matters
usage_updatecarries{ used, size }(+ optionalcost) and powers Zed'scontext‑window indicator.
usage_update, sotheir users get a live context indicator in Zed. Copilot users don't — Zed falls
back to inaccurate estimation (see Incorrectly reported token limits in agent panel on many GitHub Copilot models zed-industries/zed#44909, where Copilot models
show a hardcoded 128k limit that doesn't match the real limit).
credits you've spent — is valuable.
Request
In
--acpmode, emitsession/updatewithsessionUpdate: "usage_update":session/new,session/load,session/resume, and after each prompt turn.used(current context tokens),size(contextwindow size), and
cost(session cost) when available.via the update's
_meta(already part of theusage_updateschema), e.g._meta: { ai_credits_used, ai_credits_remaining }.This brings ACP mode to parity with the interactive statusline /
/context//usage, with no new data to compute — just forwarding what already exists over theprotocol the CLI already implements.
References
usage_update(Session Context Size & Cost RFD)Example prompts or workflows
No response
Additional context
No response