GeezerVison is showing github.com — feat(quota-plane): adapter — Claude via claude.ai session (usage API) · Issue #1163 · developing-today/code
feat(quota-plane): adapter — Claude via claude.ai session (usage API) #1163DescriptionPriority P1 — order 5c. 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.
Claude adapter: claude.ai session -> the usage API behind Settings -> Usage (5h %, weekly %, reset). SSO is Google (per Drew's SSO-first rule) at capture time. Replaces the manual Settings read.
Acceptance: Claude Pro windows current on the tick; session expiry raises re-login, never zeros.
Acceptance criteria
Activitydeveloping-today commented on Oct 27, 2026 dezren39 commented on Oct 27, 2026 REVIEW FINDING (2026-10-26): this provider's adapter ALREADY EXISTS in OpenChamber's quota module (server/lib/quota/providers). Re-scope from "build adapter" to: wire the existing provider into the quota gatherer (#1151), verify it against the live account on the gatherer host (credential provenance is the open question, per #1155), fix gaps found, and confirm its output shape maps onto quota-current. Keep this issue open until the provider is arriving on the 15-minute tick. dezren39 commented on Oct 28, 2026 Intake review
- Related: epic epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047 (quota plane, Stage 2, order 5c); design
quota-plane-design-2026-10-26.md in the usage-billing-hub goal files (§2); sibling adapters feat(quota-plane): adapter — ClinePass via dashboard session token #1159 (ClinePass, 5a), feat(quota-plane): adapter — OpenCode Go console, per-workspace windows #1161 (OpenCode Go, 5b), feat(quota-plane): adapter — Command Code via CLI/app credential #1165 (Command Code, enriched last run).
- Still live: a merged-PR search for a Claude 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: the capture route is the unknown — SSO is Google at capture time (Drew's SSO-first rule), and claude.ai session lifetime will decide how often the re-login state fires; the never-zeros rule on expiry is load-bearing because a zeroed Claude window would corrupt placement decisions downstream (feat(quota-plane): OpenCode pools consume quota-current — measured placement, rotation, demotion #1157).
- Suggested approach: probe the usage API shape behind Settings -> Usage first, then build on the epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047 framework like the sibling adapters, with the expiry path tested explicitly.
- Labels normalized by fleet monitor:
kind/feature, priority/high (P1 in body), effort/m, source/human, status/needs-triage, meta/enriched.
dezren39 commented on Nov 11, 2026
state: parked (CI wait)
task 6553 (small_fix) — issue #1163 — lane code-e, 2026-11-11
Implemented the Claude adapter and opened PR #8480: pm-stack/aggregator/src/claude-adapter.ts on the #1153 framework (ClinePass #1159 template) reads the claude.ai usage API (organizations → usage), producing the 5h and weekly windows with resets as anthropic:claude-pro quota-current rows sourced from token-adapter/claude; expired sessions surface as session-expired + re-login with last-known retained, never zeros; credentials are CredentialRef-only and move only in the Cookie header. Fixture tests in test/claude-adapter.test.ts.
Verification (laptop): targeted adapter suites 49 pass / 0 fail. Full aggregator suite: 1909 pass / 36 fail / 4 errors — and the identical 36 fail / 4 errors on the same tree with this PR's two files removed, so every full-suite failure is pre-existing and unrelated.
Terminal for this shift: task 6553 parked as a CI wait on PR #8480. Resume: when PR #8480 checks complete and Codex findings (if any) are dispositioned, merge PR #8480 and complete task 6553 with outcome pr_opened/fixed_merged. Gatherer-tick activation stays gated on #1155 credential provenance, per the #1159 precedent recorded in the PR body. dezren39 commented on Nov 11, 2026 🤖 Agent note · done (resumed, Codex P1 fixed, merged)
- Agent: repo-worker-code (queue task 6553, lane code-n)
- Session: Muse scheduled lane N, 2026-11-11T04:11Z
- Outcome: PR feat(quota-plane): Claude adapter — claude.ai usage API windows (#1163) #8480 MERGED (merge commit 875cced); this issue auto-closed by the PR.
- Resume state found: lane code-e had implemented the Claude adapter and parked task 6553 as a CI wait (checks still queued in the fleet CI backlog at merge time). This lane reviewed the PR, dispositioned its one Codex finding, and merged on local verification per standing merge authority.
- Codex P1 (comment 4533468871) — fixed: commit acb9b63 adds a seeded property sweep to test/claude-adapter.test.ts (token-adapter precedent, seed 0x1163) with the three named invariants as oracles: accepted percentages finite/in 0..100 and equal to the clamped raw value; malformed utilization never becomes a successful zero reading (no usable window → AdapterError); failed collection retains the previous entry verbatim. Disposition replied on the thread (comment 4533908538).
- Verification: bun test test/claude-adapter.test.ts — 14 pass / 0 fail (1699 expect() calls); test/token-adapter.test.ts — 19 pass / 0 fail. (Code-e's earlier verification stands for the adapter itself: targeted suites 49 pass; full-suite failures A/B-proven pre-existing.) Adapter and property tests verified present on main post-merge.
- Activation note (unchanged, by design): the gatherer activates this adapter only when a credential reference is configured; live-account activation stays gated on audit(quota-plane): name the two token-exception providers definitively #1155 credential provenance, per the PR body.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|