Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related but separate: #22862 and #31627 are about Copilot plan quota (Usage → Limits). This issue is about Copilot cost and tokens (Usage → Cost/Tokens, and the thread context meter).
Area
apps/server
Steps to reproduce
- Enable GitHub Copilot under Settings → Providers (ACP Registry,
agentId: github-copilot-cli). - Run a few turns in a Copilot thread.
- Look at the thread's context meter, then open Usage → Cost and Usage → Tokens.
Expected behavior
Copilot threads show a context meter, and Copilot appears on the Usage page with its tokens and its billed cost. Copilot now bills in AI credits, so this is the only way to track Copilot spend in T3.
Actual behavior
- No context meter on Copilot threads. Copilot CLI never sends ACP
usage_update, so no Copilot provider turn getstokenUsage. Locally, 0 of 73 Copilot turns have it, against 337 of 520 turns from other providers. - Copilot is missing from Usage → Cost/Tokens.
BUILT_IN_USAGE_DRIVERShas no Copilot reader. It covers Claude, Codex, Grok, Pi, OpenCode, Muse, Antigravity and Cursor. - ACP cost is never shown. For any agent that does report cost through
usage_update, the client maps it (cost: contextUsage.cost), but no component renders it.
Proposed fix
The data is already on disk. For every model call, Copilot CLI writes a session.usage_record to ~/.copilot/session-state/<sessionId>/events.jsonl. <sessionId> is the same ACP session ID that T3 keeps in nativeTurnRef.
{"type":"session.usage_record","timestamp":"…","data":{"usage":{
"accounting":{"sourceSessionId":"<sessionId>","usageId":"msg_…"},
"model":"claude-opus-5.5",
"copilotUsage":{"totalNanoAiu":4110200000,"tokenDetails":[…]},
"inputTokens":90652,"outputTokens":1027,"cacheReadTokens":90145,"cacheWriteTokens":505,
"reasoningTokens":0,"maxPromptTokens":200000}}}session.shutdown also carries a per-session accountingSnapshot (totalNanoAiu, per-model metrics).
totalNanoAiu / 1e9 is AI credits, and 1 credit is $0.01. Copilot's per-token rates match list prices exactly. For example, Opus 5.5 output is 2e12 nano-AIU per 1M tokens = $20/M, and input is 4e11 = $4/M.
-
Usage page: add a Copilot transcript reader that scans
~/.copilot/session-state/*/events.jsonlforsession.usage_recordevents. It should:- deduplicate by
accounting.usageId; - map the token counts to totals;
- set
reportedCostUsd = totalNanoAiu / 1e11, so the Cost view shows what Copilot actually billed.
Showing the AI-credit figure as well would help, because GitHub's own UI uses that unit.
- deduplicate by
-
Thread meter: render
contextUsage.costwhen present. Any ACP agent that reports cost would benefit. -
Optional: while Copilot CLI doesn't send
usage_update, fill the live meter from the same records (inputTokens/maxPromptTokensof the latest one).
Impact
Minor bug or occasional failure
Version or commit
T3 Code (Beta) 0.1.11, Copilot CLI 1.0.114
Environment
macOS (Darwin 25.5, Apple Silicon), desktop app
Activity
juliusmarminge commentedon Dec 1, 2026
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.