feat: show live Codex usage status in dashboard

Store Codex wham/usage live plan and rate-limit state during account refresh, surface safe dashboard badges, and keep JWT subscription expiry as stale fallback only. Redacts balance and spend limit amounts from API/UI exposure.
This commit is contained in:
Eyejoker
2026-05-23 11:12:55 +09:00
committed by GitHub
parent 763828e4f5
commit 58e5197dc6
9 changed files with 723 additions and 86 deletions

View File

@@ -425,8 +425,30 @@ async function handleMockApi(route: Route, state: MockApiState) {
accountId: 'acct_test',
email: 'codex@example.com',
planType: 'plus',
subscriptionUntil: '2099-01-01T00:00:00.000Z',
subscriptionUntil: null,
subscriptionLastChecked: '2026-01-01T00:00:00.000Z',
subscriptionSource: null,
liveStatus: {
checkedAt: '2026-01-01T00:00:00.000Z',
source: 'wham/usage',
planType: 'plus',
email: 'codex@example.com',
rateLimit: {
allowed: true,
limitReached: false,
primaryWindow: {
limitWindowSeconds: 18000,
resetAfterSeconds: 3600,
resetAt: '2026-01-01T01:00:00.000Z',
usedPercent: 8,
},
secondaryWindow: null,
},
rateLimitReachedType: null,
additionalRateLimits: [],
credits: null,
spendControl: null,
},
exists: true,
},
],