GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache · Issue #5928 · developing-today/code

quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928

New issue
Copy link
New issue
Copy link
Closed
#10001
Closed
quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache#5928
#10001
Copy link
Assignees
dezren39
Labels
design/quota-planeDesign: quota-plane - all issues of this effort carry iteffort/mMedium: expected under 1 day of workepic/fleet-orchestrationReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus/triagedTriaged and routed (see agent note)status:done

Description

@dezren39
dezren39
opened on Nov 5, 2026
Issue body actions

Problem

The quota gatherer's Claude read is in a near-permanent error state — Rate limited. Retrying soon. — even though the credential is valid. Verified 2026-11-04 (provider audit):

  • Direct probe: GET https://api.anthropic.com/api/oauth/usage with the stored OAuth access token (~/.claude/.credentials.json, expiresAt 2026-11-05T06:18:18Z) returns HTTP 429 {"error":{"type":"rate_limit_error",...}} — the token is accepted (a dead token returns 401, which the fetcher maps to "Claude session expired"), the endpoint is rate-limiting the read. Anthropic's OAuth usage endpoint is aggressively per-token rate-limited; Claude Code itself and the OpenChamber server poll it with the same token.
  • The OpenChamber quota module's claude fetcher already handles 429 correctly inside a long-lived process: it sets a cooldown from Retry-After and serves its in-process last-good cache. The gatherer, however, is a fresh oneshot process every ~15 minutes, so the cache and cooldown reset every tick: every tick pays a fresh endpoint call (adding to the very pressure that trips the limit), and no last-good read can ever be retained — there is no successful Claude percentage read in the gatherer's snapshot history through this path.

Fix shape (aggregator side, pm-stack)

Give the gatherer cross-tick memory for the claude provider, mirroring the fetcher's own design:

  • Persist { lastGoodEntry, cooldownUntil } for the claude read in the gatherer state file (quota-gatherer-state.json).
  • On a tick: if now < cooldownUntil and a last-good entry exists, emit it marked retained (the existing markRetained machinery) and skip the endpoint call entirely.
  • On a fresh 429: set cooldownUntil = now + Retry-After (fall back to the fetcher's 5 min default, cap 60 min) and emit the last-good entry retained when one exists; only surface the bare error when no read has ever succeeded.
  • On success: store the entry as the new last-good.

Acceptance: with the endpoint in its current 429 mood, consecutive ticks stop calling it every 15 min, the board's Claude row carries a retained last-good (once one exists) instead of a raw error, and the heartbeat distinguishes "in cooldown, retained" from a fresh failure. Keep the change scoped to the claude run; other providers' finalize/retention behavior (#5719) is unchanged.

Related: #5704 (WS6 gatherer fixes), #5721 (gatherer lib source).

Acceptance criteria

  • The Claude quota read no longer sits in a near-permanent Rate limited. Retrying soon. state across gatherer ticks when the endpoint is not actively limiting.
  • Cooldown/cache state survives across oneshot gatherer invocations (cross-tick memory on disk or equivalent), so the fetcher's in-process cooldown is actually honoured.
  • A 401 response still maps to 'Claude session expired' (dead-token path unchanged); a 429 maps to a bounded backoff that other pollers' activity does not reset.
  • Demonstrated over multiple consecutive ticks: state file/cache is written on a limited read and read back on the next tick.

Activity

Next
  1. developing-today commented on Nov 5, 2026

    @developing-today
    developing-todayBot
    on Nov 5, 2026 – with developing.today
    Contributor
    More actions

    CODE-1605

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    status/needs-triageNot yet triaged; needs a first look
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 5, 2026
  3. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Intake review

    Related: Proven by direct probe 2026-11-04 (provider audit): the usage endpoint returns 429 for the stored OAuth token while Claude Code and the OpenChamber server poll the same endpoint. Sibling quota work: openchamber issue #1619.

    Still-live check: searched merged PRs referencing this issue at 2026-11-05T04:31:57Z — none found; the issue stands as filed.

    Notes / risks: The endpoint is shared with other pollers; a fix that polls harder makes the fleet's rate position worse. Any cross-tick store must not leak the OAuth token into logs or world-readable files.

    Suggested approach: Persist the fetcher's cooldown/cache in a small state file beside the quota output, keyed by credential fingerprint, and have the oneshot gatherer load it before fetching and save it after.

    Acceptance criteria were appended to the issue body and labels normalised by the fleet monitor's intake pass.

  4. dezren39
    added
    queue/queuedHas a queued queue task
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 5, 2026
  5. github-actions
    assigned
    dezren39
    on Nov 5, 2026
  6. dezren39 commented on Nov 5, 2026

    @dezren39
    dezren39
    on Nov 5, 2026
    MemberAuthor
    More actions

    Agent note - handed off

    • Agent: opencode claimant (opencode-claimant)
    • Session / ID: queue task 10320; bound session ses_e5e5345bb37ffeVIwaWpY3Yh4O
    • Found via: queue task handoff on the opencode execution lane
    • Task: Triage quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928: quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gathere
    • Expectation: the bound worker session works task 10320 to a terminal queue state and must not claim another task. It revalidates the issue/PR before acting.
    • Links: quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928
  7. dezren39
    added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 5, 2026
  8. 73 remaining items

  9. dezren39
    added
    design/quota-planeDesign: quota-plane - all issues of this effort carry it
    epic/fleet-orchestrationReprioritization program epic (2026-11-12)
    on Nov 12, 2026
  10. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15213 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.

  11. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — task 15213 re-triage complete (lane any-b)

    • state: triaged
    • task: 15213
    • issue: quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928
    • kind: triage (re-packet; prior fix task 11149 terminal)
    • Fresh re-triage (2026-11-14): issue quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928 is OPEN, priority/high, no held / user/owned / do-not-merge / do-not-auto-edit labels, already carries status/triaged. The bug and fix shape are fully specified on the issue (429 proven against the valid token 2026-11-04; oneshot gatherer defeats the fetcher's in-process cooldown/cache; persist { lastGoodEntry, cooldownUntil } in quota-gatherer-state.json, claude run only). The one-writer ordering gate that parked task 11149 for days is dead: PR fix(aggregator): reject unsafe OpenChamber quota lib checkouts (#5721) #7133 was closed as superseded on 2026-11-10 (dirty/unmergeable, parent Quota gatherer ticks fail at import: lib dir resolves to stale openchamber checkout parked on a queue branch #5721 closed completed, its module never landed on main) — the hold on pm-stack/aggregator/scripts/gather-quota.ts is lifted, per the dropped-thread catcher note on this issue.
    • Route: task 15213 completes as triaged; the fix is enqueued as task 16736 (small_fix; the enqueue revived the dedupe row and cancelled the stale predecessor task 11149). Labels: quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928 keeps queue/queued for task 16736; claim-state labels from task 15213 are removed at completion.
  12. dezren39
    removed
    work/assignedQueue worker lifecycle state
    on Nov 14, 2026
  13. developing-today
    added
    status:in-review
    on Nov 14, 2026
  14. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    Agent note — task 16736 implementation landed, parked on PR CI (lane any-b)

    • state: claimed → parked (PR CI)
    • task: 16736
    • issue: quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928
    • PR: fix(quota): cross-tick memory for the Claude read (#5928) #10001 (branch fix/5928-claude-cross-tick-memory, commit c4f4c8a)
    • What landed: cross-tick memory for the _claude read in the quota gatherer — { lastGoodEntry, cooldownUntil } persisted in quota-gatherer-state.json under the reserved key claudeCrossTick:v1; in-cooldown ticks emit the last-good entry via markRetained; a fresh 429 sets the cooldown from Retry-After (fallback 5 min, cap 60 min); success stores the new last-good and clears the cooldown; the 401 Claude session expired mapping never engages the cooldown; claude run only, other providers unchanged. Pure helpers + 7 unit tests in src/quota-gather-map.ts / src/quota-gather-map.test.ts.
    • Seam disclosure (also in the PR body): the gatherer's only read is the shared opencode quota listing subcommand, which fetches all providers in one call; the cooldown governs the gatherer's consumption of the claude result (fresh result discarded, last-good emitted retained) — the aggregator-side seam the fix shape specifies.
    • Tests: new suite 7/7 pass; quota-adjacent suites 47/47 pass; tsc --noEmit clean for the touched files; the full-suite failures (18, live-source/source-gate suites) verified identical on clean main — pre-existing.
    • Next: PR fix(quota): cross-tick memory for the Claude read (#5928) #10001 CI; on green, merge and close quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928.
  15. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 14, 2026
  16. dezren39
    added a commit that references this issue on Nov 14, 2026

    Merge pull request #10001 from developing-today/fix/5928-claude-cross…

    74f5237
  17. dezren39
    closed this as completedin #10001on Nov 14, 2026
  18. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 14, 2026
  19. dezren39 commented on Nov 14, 2026

    @dezren39
    dezren39
    on Nov 14, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done — PR #10001 merged

    • Agent: repo queue worker, lane code-c (repo-worker-code)
    • Session / ID: task 16736 (resume claim; implementation and first test pass were the prior claim's, parked on PR fix(quota): cross-tick memory for the Claude read (#5928) #10001)
    • Outcome: PR fix(quota): cross-tick memory for the Claude read (#5928) #10001 fix(quota): cross-tick memory for the Claude read (#5928) merged. The change is additive only (204 additions, 0 deletions): pm-stack/aggregator/src/quota-gather-map.ts (last-good + 429 cooldown persisted in the gatherer state file under the reserved v1 key), its hookup in pm-stack/aggregator/scripts/gather-quota.ts, and quota-gather-map.test.ts.
    • Verification this claim: fresh run of the targeted suite on the PR head (c4f4c8a) in a clean laptop worktree — bun test src/quota-gather-map.test.ts: 7 pass, 0 fail (state-key, parse/serialize round-trip, 429-vs-401 classification, Retry-After parsing, cooldown caps). PR checks: no CI gate runs on PRs in this repo (CI on main); Codex review run failed on quota with zero findings (0 inline comments), the standing non-blocker. No hard-stop labels on the PR or this issue at merge time.
    • Links: task 16736 · PR fix(quota): cross-tick memory for the Claude read (#5928) #10001 · issue quota: claude read needs cross-tick memory — usage-endpoint 429 (proven) + oneshot gatherer defeats the fetcher's in-process cooldown/cache #5928
  20. dezren39
    removed
    queue/queuedHas a queued queue task
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

design/quota-planeDesign: quota-plane - all issues of this effort carry iteffort/mMedium: expected under 1 day of workepic/fleet-orchestrationReprioritization program epic (2026-11-12)kind/bugSomething isn't working (prefixed form of the classic bug label)meta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivestatus/triagedTriaged and routed (see agent note)status:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.