Skip to content

fix(usage): report exhausted quotas and account balances reliably - #15

Merged
unlockdigital merged 2 commits into
unlock-digital/mainfrom
fix/usage-account-billing
Nov 7, 2026
Merged

unlockdigital merged 2 commits into
unlock-digital/mainfrom
fix/usage-account-billing

Conversation

@unlockdigital

Copy link
Copy Markdown
Owner

Problem

Usage could show a full Copilot allowance for an exhausted account and leave a configured Claude API balance unknown. Undisclosed credit amounts and connections without usage reports also lacked useful explanations.

Change

  • Preserve exhausted Copilot allowances when hasQuota is false, exclude unlimited chat/completion entitlements from premium-credit percentages, and omit expired reset timestamps.
  • Make the saved-profile Console billing reader available when provider services are created, and retain explicit failure status after unsuccessful quota refreshes.
  • Explain credit availability and missing usage on each account card. Keep billing links in account details and remove the duplicate billing sections.

Scope and approval

Maintainer-requested usage reliability update for the Unlock Digital fork. The shared provider fixes apply across clients; the account-card changes apply to web and desktop.

Verification

  • vp run check:changed origin/unlock-digital/main: formatting, lint, both knip passes, GraphQL generation, typechecks for 33 affected packages, focused tests, and React compiler checks.
  • Regression coverage includes exhausted Copilot credits, stale quota reads, credit amounts withheld by the provider, missing usage explanations, and billing links in account details.
  • Live local verification confirmed the expected exhausted-credit state and a numeric API balance after repeated refreshes.
  • Gitleaks found no secrets in the changed source files. Runtime settings, credentials, cookies, real account identifiers, and live balances remain local. These captures use synthetic accounts and balances; review assets are hosted outside the source commit.

Before:

Usage with synthetic accounts before the fix

After:

Usage with synthetic accounts after the fix

Model: GPT-6.1 Sol. Harness: Codex in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB +6 B (+0.1%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.3 KiB +6 B (+0.5%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.6 KiB 21.6 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 2 2 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.3 KiB 1.3 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 2 2 0 (0.0%) 8 ✅

Baseline: 165192e · PR result: 73a4c51 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@unlockdigital
unlockdigital merged commit 1fc00bb into unlock-digital/main Nov 7, 2026
27 checks passed
@unlockdigital
unlockdigital deleted the fix/usage-account-billing branch November 7, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant