Skip to content

feat(quota-plane): aggregator lazy refresh — pull on page load when data >5 min old #1171

Closed

Description

@dezren39

Priority P1 — order 8. Horizon: Week. Design: quota-plane-design-2026-10-26.md (usage-billing-hub goal files), Stage 2. Parent context: epic #1047. (§1, lazy refresh) — Drew: "pull it on page load if it hasn't been updated in the past minute or 5 minutes."

Aggregator change: on /quota page load (and /api/quota.json), check the newest measuredAt; if older than 5 minutes, kick the gatherer asynchronously and render current data with a visible "refreshing" marker; add a manual refresh-now control using the same path. Page loads never block on provider calls; concurrent loads dedupe to one gatherer run.
Acceptance: with the gatherer paused, loading /quota triggers exactly one refresh and the page shows the marker then fresh data; with fresh data, no trigger fires.

Acceptance criteria

  • With the gatherer paused, loading /quota (or /api/quota.json) with data older than 5 minutes triggers exactly one refresh and the page shows a visible "refreshing" marker, then fresh data.
  • With fresh data (<5 min), no refresh trigger fires on page load.
  • A manual refresh-now control uses the same path; concurrent loads dedupe to one gatherer run and page loads never block on provider calls.

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. added
    source/humanFiled directly by a human
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: Quota-plane Stage 2, parent epic #1047, order 8 / P1 per the body. Sibling quota-plane batch this run: #1170, #1169, #1167.

    Notes / risks: Lazy refresh must never block a page load on a provider call — async kick + marker only; the dedupe of concurrent loads is the subtle part.

    Suggested approach: Check the gatherer's existing trigger surface first; reuse it for the manual refresh-now control.

    Live check: verified still open and unheld this run; a merged-PR search on this run (2026-10-28T10:35:00Z) returned no PR resolving this issue, so it remains live work. Acceptance criteria appended to the body (original text preserved verbatim above it) and labels normalized by the fleet monitor.

  4. added
    mode/onlineFully doable remotely: design, config, code, cloud
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  5. 115 remaining items

  6. added
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 4, 2026
  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    OpenCode claimant launched the bound worker session ses_e5e5823c05cffecaps5E0WQLdc for queue task 6561. The worker will use --worker repo-worker-code and finish task 6561 with execution lane=opencode and this session id.

  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — state: in_progress

    • Agent: queue worker (repo-worker-code), execution lane opencode
    • Session / task: ses_e5e5823c05cffecaps5E0WQLdc / 6561
    • Progress: continued existing PR fix(aggregator): refresh stale quota on demand (#1171) #5263, without opening a competing PR. Fixed stale snapshots being masked by recent gatherer ticks and error-state attempts; made the refreshing marker neutral for manual refreshes on fresh data. Codex P2 on failed-attempt freshness was addressed and resolved in commit 4b148f2.
    • Verification on head 4b148f2: aggregator suite 1530 pass, contract corpus 21 pass. bunx tsc --noEmit still fails only at src/item-history.ts:58 (TS2304: GhKind), outside this PR's diff; current-head workflow run 41893232235 confirms the same. PR status reports no required-check/review blockers.
    • Next: finish the fresh review/merge-queue check, then record completion.
  10. added a commit that references this issue on Nov 4, 2026
  11. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — state: completed

    • Agent: queue worker (repo-worker-code), execution lane opencode
    • Session / task: ses_e5e5823c05cffecaps5E0WQLdc / 6561
    • Result: existing PR fix(aggregator): refresh stale quota on demand (#1171) #5263 was merged by merge commit e25ebcd; no competing PR was opened.
    • Fix: request freshness now ignores gatherer attempt timestamps and error-state pool, credential, and provider timestamps; manual refresh uses a neutral refreshing message. Codex P2 feedback was fixed in 4b148f2 and resolved.
    • Verification on head 4b148f2: aggregator suite 1530 pass, contract corpus 21 pass. The optional typecheck still fails only at unchanged src/item-history.ts:58 (TS2304: GhKind), outside this PR. PR reported no required-check/review blockers before merge.
    • Links: PR fix(aggregator): refresh stale quota on demand (#1171) #5263; current-head test run 41893232235.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedmeta/follow-upFollow-up spun out of earlier workmode/onlineFully doable remotely: design, config, code, cloudpriority/highImportant and time-sensitivesource/humanFiled directly by a humanstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions