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(quota-plane): adapter — Command Code via CLI/app credential #1165
Priority P1 — order 5d. Horizon: Month. Design: quota-plane-design-2026-10-26.md (usage-billing-hub goal files), Stage 2. Parent context: epic #1047. (§2) — on the framework + gatherer from this epic.
Command Code adapter: CLI/app credential -> usage state ($ used of 0 credits, window %) without a dashboard visit. The CLI route is verified working on the sandbox (resident ACP); check whether its status surface carries quota before reaching for the dashboard API.
Acceptance: Command Code current on the tick from a machine route.
Acceptance criteria
Command Code's current usage state ($ used of 0 credits, window %) reaches the quota-plane tick from a machine route — the body's one-line Acceptance, restated and expanded here as the criteria section.
The CLI status surface is checked first for quota data before any dashboard API route is used, and the chosen route is documented on the adapter.
RE-SCOPE (2026-10-26, per Drew + git archaeology): the Command Code quota provider existed and was dropped upstream (openchamber 1b1a95ff6) because the OFFICIAL API has no usage endpoints — its source was the unofficial studio API. Our fleet's route is documented in the quota module's own DOCUMENTATION.md: resolve account scope via GET /alpha/whoami, then GET /alpha/billing/credits?orgId=... (personal accounts: org null, no orgId) for credit balances + 5h/weekly limits, authed by the command-code OpenCode auth entry (OAuth access) or COMMAND_CODE_API_KEY.
Work: (1) recover the dropped provider from openchamber history (279f248a0, providers/command-code.js + tests) into our fork as a restoration — do not redesign from scratch; (2) verify the /alpha endpoints against our live credential; (3) if the studio API has drifted, adapt parsing fail-closed; (4) wire into the gatherer path like the other providers. Drew used Command Code this week; its $10-credit state is currently read by hand.
The dropped provider is recovered verbatim from openchamber history (279f248a0 / pre-drop state at 1b1a95ff6^) on branch feat/restore-command-code-quota, then adapted to the current quota module: injected readOpenCodeCredentials (the old readAuthFile no longer exists), registry aliases, and per-credential fetching via the registry's fetchWithCredentialRead, matching ClinePass/DeepInfra. Parse logic and the /alpha/whoami → /alpha/billing/credits flow are the recovered code unchanged. PR: feat(quota): restore the Command Code usage provider openchamber#528 (not merged — merge stays with Drew).
Live verification (2026-10-26, repeated 2026-10-27 from the laptop per the laptop-only execution rule): GET /alpha/whoami → 200, org: null (personal account). GET /alpha/billing/credits → 200 with exactly the documented shape — credits{monthlyCredits, purchasedCredits, freeCredits}, windowLimits{fiveHour, weekly}{used, cap, resetAt} — no drift the parser can't handle; extra fields are ignored. Current reading: monthly credits 3.15, purchased 0, free 0; 5h window 0.0134 / 3 used (reset 2026-10-27 ~02:45 CDT); weekly 0.808 / 6 used (reset ~2026-10-31).
Full wired path proven on the laptop: the laptop's OpenCode server store holds an active commandcode key (30 rows), and openchamber quota command-code --json from the restored branch returns ok: true, configured: true with the live windows.
Tests (all on the laptop): provider + registry 25 passed; full quota suite 498 passed (37 files); bun run check:changed passed with no new anti-slop findings. (A sandbox gate attempt failed only on that worktree's incomplete dependency install; the laptop run supersedes it.)
One precise remaining gap, environment rather than code: the SANDBOX server's credential store (23 rows) has no command-code credential — its key lives only in legacy auth.json there. So the sandbox CLI reports "Not configured" until that credential is seeded into the sandbox server store. The laptop, the fleet's real server, already has it and works end to end.
MERGED 2026-10-27: openchamber PR #528 (Command Code quota provider restoration) merged after full CI green (build/tests/gate/lint/type-check) + laptop live verification. The restored provider is on openchamber main; fleet rollout follows the normal build/deploy path. Remaining from this issue: gatherer wiring of the command-code provider (rides #1151's provider coverage).
Still live: a merged-PR search for a Command Code quota adapter found no resolving PR; the issue carried only meta/follow-up before this pass.
Notes: the body states "Priority P1" in prose — normalized here to priority/high. Its Acceptance line has been expanded into the appended ## Acceptance criteria section (original body preserved verbatim above it).
Risks: credential route is the unknown — the body notes the CLI route is verified working on the sandbox (resident ACP), but whether its status surface carries quota is exactly what must be checked before designing around a dashboard API.
agent-note:v1
state: done
task_id: 2449
worker: repo-worker-code
lane: aea12c82-c5af-4e5a-9b66-f8e360f87177
at: 2026-11-02T22:46:00Z
outcome: already_done
summary: Closing as satisfied; the Command Code quota adapter and its gatherer-to-/quota path are implemented and merged, so no follow-up task remains.
evidence: OpenChamber main contains packages/web/server/lib/quota/providers/command-code.js (merged PR #528); code main scripts/gather-quota.ts enumerates configured providers and fetches each provider via the OpenChamber module (PR #1309); src/sources/live.ts overlays quota-current into /quota (PR #1329); Command Code latest-read parsing fix #3413 is merged. Current main commits: code f2c6259; OpenChamber 3194bcffc13dc1f965d6e296243757401ce3af4a.
Activity
developing-today commentedon Oct 27, 2026
CODE-301
dezren39 commentedon Oct 27, 2026
RE-SCOPE (2026-10-26, per Drew + git archaeology): the Command Code quota provider existed and was dropped upstream (openchamber 1b1a95ff6) because the OFFICIAL API has no usage endpoints — its source was the unofficial studio API. Our fleet's route is documented in the quota module's own DOCUMENTATION.md: resolve account scope via GET /alpha/whoami, then GET /alpha/billing/credits?orgId=... (personal accounts: org null, no orgId) for credit balances + 5h/weekly limits, authed by the
command-codeOpenCode auth entry (OAuth access) or COMMAND_CODE_API_KEY.Work: (1) recover the dropped provider from openchamber history (279f248a0, providers/command-code.js + tests) into our fork as a restoration — do not redesign from scratch; (2) verify the /alpha endpoints against our live credential; (3) if the studio API has drifted, adapt parsing fail-closed; (4) wire into the gatherer path like the other providers. Drew used Command Code this week; its $10-credit state is currently read by hand.
dezren39 commentedon Oct 27, 2026
Restoration status (2026-10-26):
feat/restore-command-code-quota, then adapted to the current quota module: injectedreadOpenCodeCredentials(the oldreadAuthFileno longer exists), registryaliases, and per-credential fetching via the registry'sfetchWithCredentialRead, matching ClinePass/DeepInfra. Parse logic and the/alpha/whoami→/alpha/billing/creditsflow are the recovered code unchanged. PR: feat(quota): restore the Command Code usage provider openchamber#528 (not merged — merge stays with Drew).GET /alpha/whoami→ 200,org: null(personal account).GET /alpha/billing/credits→ 200 with exactly the documented shape —credits{monthlyCredits, purchasedCredits, freeCredits},windowLimits{fiveHour, weekly}{used, cap, resetAt}— no drift the parser can't handle; extra fields are ignored. Current reading: monthly credits 3.15, purchased 0, free 0; 5h window 0.0134 / 3 used (reset 2026-10-27 ~02:45 CDT); weekly 0.808 / 6 used (reset ~2026-10-31).commandcodekey (30 rows), andopenchamber quota command-code --jsonfrom the restored branch returnsok: true, configured: truewith the live windows.bun run check:changedpassed with no new anti-slop findings. (A sandbox gate attempt failed only on that worktree's incomplete dependency install; the laptop run supersedes it.)auth.jsonthere. So the sandbox CLI reports "Not configured" until that credential is seeded into the sandbox server store. The laptop, the fleet's real server, already has it and works end to end.dezren39 commentedon Oct 27, 2026
MERGED 2026-10-27: openchamber PR #528 (Command Code quota provider restoration) merged after full CI green (build/tests/gate/lint/type-check) + laptop live verification. The restored provider is on openchamber main; fleet rollout follows the normal build/deploy path. Remaining from this issue: gatherer wiring of the command-code provider (rides #1151's provider coverage).
dezren39 commentedon Oct 28, 2026
Intake review
quota-plane-design-2026-10-26.mdin the usage-billing-hub goal files (§2); sibling adapters in the same epic are the pattern to match.meta/follow-upbefore this pass.priority/high. Its Acceptance line has been expanded into the appended## Acceptance criteriasection (original body preserved verbatim above it).kind/feature,priority/high(P1 in body),effort/m,source/human,status/needs-triage,meta/enriched.dezren39 commentedon Nov 2, 2026
agent-note:v1
state: picked_up
task_id: 2449
worker: repo-worker-code
lane: aea12c82-c5af-4e5a-9b66-f8e360f87177
at: 2026-11-02T22:44:12Z
summary: Claimed triage; validating Command Code adapter and quota-gatherer completion on current main.
dezren39 commentedon Nov 2, 2026
agent-note:v1
state: done
task_id: 2449
worker: repo-worker-code
lane: aea12c82-c5af-4e5a-9b66-f8e360f87177
at: 2026-11-02T22:46:00Z
outcome: already_done
summary: Closing as satisfied; the Command Code quota adapter and its gatherer-to-/quota path are implemented and merged, so no follow-up task remains.
evidence: OpenChamber main contains packages/web/server/lib/quota/providers/command-code.js (merged PR #528); code main scripts/gather-quota.ts enumerates configured providers and fetches each provider via the OpenChamber module (PR #1309); src/sources/live.ts overlays quota-current into /quota (PR #1329); Command Code latest-read parsing fix #3413 is merged. Current main commits: code f2c6259; OpenChamber 3194bcffc13dc1f965d6e296243757401ce3af4a.