Repository navigation
Description
Status and goal
Backlog investigation/implementation candidate only. The user explicitly deferred
tpatch registration: do not create a tpatch feature or implementation branch yet.
Backlog: #1. Related: #16 capability inventory; #21 context-window controls is a
different measurement and must remain separate.
Expose GitHub Copilot account allowance and session usage in T3 Code without
scraping the native CLI display, starting extra model turns, or confusing
subscription usage with the model's context-window occupancy.
Verified starting point
The fork uses @github/copilot-sdk 1.0.8. Its public generated RPC surface offers:
const plan = await client.rpc.account.getQuota({});
const usage = await session.rpc.usage.getMetrics();These calls assume an already connected client/session. They are marked
experimental, so compatibility and unavailable-method handling need explicit
coverage before adoption.
- Account quota returns
quotaSnapshots, keyed by quota category, with fields
includingentitlementRequests,usedRequests,remainingPercentage,
resetDate, unlimited entitlement, and overage/continued-usage flags. - Session metrics expose accumulated
totalNanoAiu, token details, per-model
usage, premium-request cost, and session start time. - The raw account response has
token_based_billingmetadata. Older field names
still say "requests": validate quota categories and AI-credit conversion
against the actual runtime before selecting labels or doing arithmetic. - The fork's Copilot adapter already accumulates per-turn
totalNanoAiu, but its
provider health probe currently reads status/auth/models, not account quota.
Copilot native history is not yet included in the global usage scanner.
Evidence:
- SDK account quota RPC.
- SDK quota snapshot fields.
- SDK session usage metrics.
- Fork provider probe.
- Fork usage accumulation.
- Existing usage and limits UX.
No authenticated quota response was retrieved during this research, and no
provider turn was started. Exact unit normalization, refresh behavior, and
session accounting after resume remain to be verified.
Proposed scope and acceptance
- Read quota using the owning environment's configured Copilot identity. A
phone or desktop viewing a remote thread must not query its own unrelated
local credentials. - Prefer existing Usage > Limits, provider snapshots, refresh controls, and
/usage-limitspresentation over another standalone meter. Cover web,
desktop, and native mobile; decide widget coverage explicitly. - Display account allowance and session usage separately. Never reconstruct a
subscription balance by subtracting local session totals, and never label
context tokens or API-equivalent cost as the subscription bill. - Preserve billing units, quota category, reset/observation timestamps,
unlimited entitlement, and overage policy. Missing or unsupported data must
be visibly unavailable, not zero usage or a fabricated entitlement. - Add explicit stale/error handling and bounded server-owned refresh. Reuse
existing health/status refresh behavior where appropriate; multiple clients
must not launch independent unbounded quota probes. - Deduplicate the same account across environments only when supported
identity evidence is sufficient. Keep separate accounts distinguishable.
Do not infer shared allowance from equal labels, paths, or plan names. - For session usage, verify resumed sessions, repeated usage events, model
changes, subagents, cache categories, and interrupted/failed turns. Do not
silently claim a complete historical scan from partial per-turn telemetry. - Determine whether any contract extension is necessary to preserve absolute
allowance/used counts and explicit units alongside existing percentage
windows. Keep SDK-specific parsing at the adapter boundary. - Focused tests should cover unlimited and absent quotas, exhausted allowance,
overage enabled/disabled, reset, stale failures, runtime compatibility,
unit conversion, and environment/account scoping.
Broad Copilot history scanning, context-tier controls, provider migration, and
new notification behavior are not implicit additions to this item. Assess
maintained-root ownership before a later tpatch request; avoid overlapping the
existing Copilot provider root.
Recorded by GPT-6 Astra using GitHub Copilot CLI; no delegated implementation.
Activity