You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(usage-hub): Codex usage reader via wham/usage route (daily, per credential) #1112
Part of epic #1047. Design: hub-v2-v3-design-2026-10-26.md §3.
The Codex pool's manual read is the weakest in family 1: the registry records the chatgpt.com codex usage endpoint returning 403 with the stored OAuth token. But the OPENAI LOGINS record (2026-10-25) verifies the legacy chatgpt-browser login (drewrypope) reads wham/usage fine, and the store holds TWO distinct OpenAI logins.
Build a small daily reader on the working route: 7-day window %, reset credits, reset time — recorded per credential (see the per-credential issue in this epic), fed to quota-view/registry + snapshots. If the route dies, the pool falls back to the daily console read (already live in stewardship's DAILY CONSOLE READS block) and the card must say so.
Acceptance: Codex card freshness goes from manual/weekly-era to daily automated, with the source named; a 403 regression shows as stale, never as 0%.
REVIEW FINDING (2026-10-26): the wham/usage route is ALREADY IMPLEMENTED — OpenChamber's codex quota provider fetches https://chatgpt.com/backend-api/wham/usage, including per-credential rows. Re-scope this issue to: wire that provider into the routine gather path (stewardship quota-view + hub snapshots today; the #1151 gatherer next), verify both OpenAI logins' rows live, and retire the manual Codex read once the wired path proves stable for a week.
Verdict: The reader this issue asks for exists, is running, and meets every acceptance point — verified live on the laptop at 2026-10-29T02:45Z, not just from code:
Route: OpenChamber's quota module ships a Codex provider (packages/web/server/lib/quota/providers/codex.js in developing-today/openchamber) that GETs https://chatgpt.com/backend-api/wham/usage — the exact route named here — including primary/secondary windows, reset stamps, and credits.
Per credential:fetchQuotaForCredential (landed 2026-10-26 in openchamber 8e18868c, "per-credential and instance quota"; percentage-clamp fix 145d8f4d 2026-10-27) plus the hub gatherer (pm-stack/aggregator/scripts/gather-quota.ts, direct credential-store read) produce one row per login. Live quota-current.json right now holds BOTH rows: "OpenAI" (legacy Codex sign-in) state ok, weekly 22%, credits window present; "OpenAI 2" (Sign-in-with-ChatGPT token-sharing login) state error.
Daily automated, source named:snapshots/usage-2026-10.jsonl shows openai:codex weekly values written by quota-gatherer (source api) throughout today — 21% at 01:15Z, 22% at 02:30Z, resetsAt 2026-11-04 — far fresher than the manual/weekly-era baseline this issue filed against. Hub entries carry source openchamber-quota.
Failure never reads as 0%: the token-sharing credential, which OpenAI refuses at this endpoint, surfaces as an explicit error entry ("OpenAI shows usage for Sign in with ChatGPT only at chatgpt.com/settings/usage. The legacy Codex sign-ins show it here.") with empty windows — the mapper's documented never-zeros contract — exactly the stale/error-not-zero behavior required here.
Activity
developing-today commentedon Oct 27, 2026
CODE-250
dezren39 commentedon Oct 27, 2026
REVIEW FINDING (2026-10-26): the wham/usage route is ALREADY IMPLEMENTED — OpenChamber's codex quota provider fetches https://chatgpt.com/backend-api/wham/usage, including per-credential rows. Re-scope this issue to: wire that provider into the routine gather path (stewardship quota-view + hub snapshots today; the #1151 gatherer next), verify both OpenAI logins' rows live, and retire the manual Codex read once the wired path proves stable for a week.
dezren39 commentedon Oct 29, 2026
🤖 Agent note · done (triage verdict: ALREADY IMPLEMENTED — closing with evidence)
packages/web/server/lib/quota/providers/codex.jsin developing-today/openchamber) that GETshttps://chatgpt.com/backend-api/wham/usage— the exact route named here — including primary/secondary windows, reset stamps, and credits.fetchQuotaForCredential(landed 2026-10-26 in openchamber 8e18868c, "per-credential and instance quota"; percentage-clamp fix 145d8f4d 2026-10-27) plus the hub gatherer (pm-stack/aggregator/scripts/gather-quota.ts, direct credential-store read) produce one row per login. Livequota-current.jsonright now holds BOTH rows: "OpenAI" (legacy Codex sign-in) state ok, weekly 22%, credits window present; "OpenAI 2" (Sign-in-with-ChatGPT token-sharing login) state error.snapshots/usage-2026-10.jsonlshowsopenai:codexweekly values written byquota-gatherer(sourceapi) throughout today — 21% at 01:15Z, 22% at 02:30Z, resetsAt 2026-11-04 — far fresher than the manual/weekly-era baseline this issue filed against. Hub entries carry sourceopenchamber-quota.packages/web/server/lib/quota/providers/codex.js·pm-stack/aggregator/scripts/gather-quota.ts