Repository navigation
Conversation
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — Copilot history is now automatically included in usage summaries, even without a configured Copilot account. Human review must confirm this default expansion of history coverage and displayed costs. Needs human approval because:
Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Copilot provider identity packages/contracts/src/usage.ts, packages/provider-acp-registry/src/server/copilotAcp.ts, packages/provider-acp-registry/src/server/adapter.ts, apps/web/src/components/usage/usageProviders.ts, apps/mobile/src/features/usage/usageProviders.ts |
The usage provider contract and presentation include Copilot. ACP Registry Copilot detection uses isCopilotAgent, which checks local command names or the registry agent ID. |
Parse Copilot session receipts packages/provider-acp-registry/src/server/copilotUsage.ts, packages/provider-acp-registry/src/server/copilotUsage.test.ts |
The reader scans Copilot session-state event files and parses usage receipts. It validates token values, deduplicates usage identities, and reports costs when complete credit data is available. Tests cover resumed sessions, subagents, BYOK, and malformed or incomplete receipts. |
Register the usage reader packages/provider-acp-registry/src/server/driver.ts, apps/server/src/provider/builtInDrivers.ts, apps/server/src/usage/UsageService.test.ts |
The ACP Registry driver uses the Copilot reader, and the server includes the driver in its built-in usage drivers. The service test covers configured and host Copilot histories, resumed sessions, and subagent receipts. |
Present Copilot usage apps/web/src/components/usage/UsageLimits.tsx, apps/web/src/components/usage/UsageModelDialog.tsx, apps/web/src/components/usage/UsagePage.tsx, apps/web/src/components/usage/UsageProviderChart.tsx, apps/web/src/components/usage/UsageProviderChart.test.ts, apps/mobile/src/features/usage/usageProviders.ts, docs/user/usage.md |
Usage views pass ACP Registry agent IDs to provider icons, and hidden ACP Registry providers are handled separately when filtering limits. Mobile provider labels and colors, chart expectations, and usage documentation include Copilot. The documentation describes session sources and the recorded AI-credit cost. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant AcpRegistryDriver
participant copilotUsageReader
participant CopilotSessionStateFiles
participant copilotUsageFormat
AcpRegistryDriver->>copilotUsageReader: Configure usage reader
copilotUsageReader->>CopilotSessionStateFiles: Scan session-state event files
CopilotSessionStateFiles-->>copilotUsageReader: Return event lines
copilotUsageReader->>copilotUsageFormat: Parse receipt events
copilotUsageFormat-->>copilotUsageReader: Return usage records
Possibly related PRs
- pingdotgg/t3code#10409: Adds the usage-history reader framework and ACP Registry integration extended here for Copilot.
- pingdotgg/t3code#23380: Adds another ACP Registry session-history reader through the usage-reader contract.
Suggested reviewers: maria-rcks, juliusmarminge, wiktor102
Merge Risk: 
Minimal · previous review 618f1
-
No confirmed issue prevents merging after normal checks.
Pre-merge checks: 
3 · 
1
-
Failed checks: 1 inconclusive Passed checks: 3 passedFull details: Description check
-
Explanation
The description states the problem (GitHub Copilot sessions are missing from Usage because the ACP Registry driver has no usage reader), the change (a transcript reader for Copilot CLI
session.usage_recordevents,copilotadded to the provider contract, web and mobile labels and colors, and a user guide update), and the scope (Copilot plan quota is excluded). It also includes the required Verification details: named test files with covered cases, a reported total checked against an independent sum,vp run check:changedpassing, and unchecked items. The Before/After screenshots cover the UI change. The template's Scope and approval section is only partly satisfied. It cites prior maintainer-approved provider-parity paths (#17848,#22443,#19060) and a related issue (#22866), but it does not link a triaged bug issue or explicit maintainer approval for this specific change. The title is not in the description body, so the conventional-commit title is not checked here.Resolution
Add a link to the triaged issue or discussion that gives explicit maintainer approval for adding Copilot usage. Include the approval comment. The description cites
#17848,#22443, and#19060as parity precedent, but these do not show approval for this change. Confirm that the PR title follows the conventional commit format from the template.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
Usage read local history for every provider except Copilot, so Copilot calls made through T3 or the Copilot CLI were missing from tokens, cost, the hourly chart, and the model breakdown. The ACP Registry driver now reads Copilot CLI's session-state/<id>/events.jsonl from ~/.copilot or COPILOT_HOME, for the host and for each Copilot instance; other registry agents contribute nothing. Only durable session.usage_record receipts count. Shutdown totals overlap them. Input tokens include cache reads and writes, and subagent receipts keep their own model under the parent session. Each model call is deduplicated by a digest of its accounting usageId, so a call re-appended after a resume counts once. Cost is Copilot's recorded nano-AIU at $0.01 per AI credit when the credits are complete, otherwise model rates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot reports complete AI-credit accounting including explicit zeros, so a complete receipt with no charge is not an unknown cost to price by model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ost Copilot history Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
618f1fd to
8d4dae5
Compare
|
closing at @StiensWout's request under Establish the problem and scope first. This adds a new GitHub Copilot native-history reader and usage provider, including credit billing interpretation, default host-history discovery, deduplication and web/mobile presentation. The cited Pi and Muse PRs are approval for those providers, not Copilot. Full issue 19060 explicitly calls the Muse gap a provider-parity feature request and invites the Muse reader only. No explicit maintainer approval for this Copilot direction/scope is linked or present on this PR. Get explicit maintainer approval for adding Copilot native session history and its cost/discovery scope, then link that approval. Existing Pi/Muse invitations do not approve every provider-parity feature. thanks for trying to help improve t3 code. if you think this closure was a mistake, please open a fresh pr addressing the requirement above, and link back to this one. |
GitHub Copilot is missing from Usage. Copilot runs through the ACP Registry driver, and that driver has no usage reader. Copilot CLI sessions therefore never count toward cost, tokens, or the model breakdown. The CLI already writes a usage receipt for every model call to
~/.copilot/session-state/<session>/events.jsonl.This follows the provider-parity path maintainers set for Pi (#17848) and Muse Code (#22443, invited in #19060). Copilot's plan quota in Limits is a separate request (#22866) and is not part of this PR.
#23380 (Mistral Vibe) also sets the ACP Registry driver's
usagereader, and a driver has only one. If both land, the second needs the two readers combined into one that dispatches by agent.How
session.usage_recordevents, including subagent calls. It reads~/.copilot/session-state, orsession-stateunderCOPILOT_HOMEfrom the server environment or a Copilot account's environment. Like the other providers' default homes, the host's Copilot home counts even without a configured Copilot account, so Copilot CLI sessions run outside T3 Code count too. Accounts that run other ACP agents add nothing, and homes shared by several accounts count once.usageId, so a resumed session that replays earlier receipts adds nothing. Copilot'sinputTokensincludes cache reads and writes, so the reader splits those out. Reasoning tokens are already part of output.totalNanoAiu, $0.01 per credit) whenaiCreditsStatusiscomplete, including a complete zero. Partial or missing credits fall back to thegithub_copilot/<model>price, and BYOK models use the model's own price. The receipt'scostfield is a premium-request multiplier, not money, so the reader ignores it.copilotjoins the usage provider contract. Web and mobile label it GitHub Copilot with the Copilot icon and Copilot Purple (#8534f3, from GitHub's brand colors). Hiding Copilot in the provider filter leaves other ACP Registry agents' limits visible.Before
Usage has no GitHub Copilot entry, and Copilot sessions count nowhere.
After
Usage filtered to GitHub Copilot, over 10 real Copilot CLI sessions.
Verification
copilotUsage.test.tsparses receipts shaped like Copilot CLI 1.0.105 output: main and subagent receipts across a resume, skipped shutdown totals, complete, zero, partial, unavailable, and missing credits, BYOK models, and malformed counters.UsageService.test.tsreads the host home and a Copilot account'sCOPILOT_HOMEonce each, skips a non-Copilot account's home, keeps the host home when another agent holds theacpRegistryinstance ID, and counts a resumed session's receipts once. The last case fails without the reader's host-ID check.vp run check:changedpasses.Not checked: Copilot CLI versions before 1.0.105, and the mobile Usage screen on a device. Not supported: the legacy
--config-dirflag in an account's launch arguments. GitHub recommendsCOPILOT_HOME, which works per account.Implemented with Claude Opus 5.5 in Claude Code, running in T3 Code. Reviewed with GPT 6.1 Sol in Codex.
🤖 Generated with Claude Code