Skip to content

feat(usage-hub): per-credential quota rows — stop collapsing same-type logins #1113

Closed

Description

@dezren39

Part of epic #1047. Design: hub-v2-v3-design-2026-10-26.md §4.

Problem (Drew, 2026-10-25; investigated, not built): the credential projection keeps only the ACTIVE credential per integration, so multiple same-type logins collapse into one quota row. OpenChamber's quota CLI solved the listing side (PR #474 merged: per-credential + provider-instance quota, disabled_providers respected) — the hub feed/render side never got the same treatment.

Work: carry provider instances through the fleet feed (check-usage snapshots distinguish some already); render one row per credential where quotas genuinely differ (OpenAI x2 logins, OpenCode Go x2 workspaces) with the pool total as headline; where credentials share one pool, render one row — never a fake split.
Acceptance: the two-OpenAI-login case renders correctly per its real pool structure; Go Personal vs Lab stay distinct; tests cover both shapes.

Activity

  1. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane A shift
    • Session / ID: queue task 2392 (triage) → follow-up queue task 3004
    • Found via: queue claim
    • Task: Triage verdict for feat(usage-hub): per-credential quota rows — stop collapsing same-type logins #1113
    • Verdict — CONFIRMED at HEAD, and the gap is precisely located: the gather side already works per credential — scripts/gather-quota.ts reads OpenCode's credential store directly and fetches per provider instance, and src/quota-gather-map.ts carries credentialId/credentialLabel per result. The collapse happens in projection/render: src/quota-current.ts overlayQuotaCurrent groups entries by serviceId and applies only the newest fresh-ok entry (freshOk[0]) to the single pool — the module header says it outright: "Several entries can share a serviceId (one per credential): a fresh ok entry wins… otherwise the newest entry decides." Every other login's windows are dropped, and src/render.ts renders one card per pool, so credentialLabel never becomes a row. The test fixtures in test/quota-current.test.ts (~lines 118–124) already model the real shape: two entries for one service labelled "OpenAI" and "OpenAI 2".
    • Routing: scoped implementation packet enqueued as queue task 3004 (dedupe repo-health:v1:fix:developing-today/code:issue:1113): carry per-credential rows through the view model, split only where quotas genuinely differ (pool total as headline), one row for shared-pool credentials (never a fake split), render + /api/quota.json, tests for both shapes including Go Personal vs Lab staying distinct.
    • Expectation: feat(usage-hub): per-credential quota rows — stop collapsing same-type logins #1113 stays open with queue/queued until task 3004 lands.
    • Links: epic epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047; design §4; packet packet-task2392-fix1113.json (goal hidden_files)
  4. added
    queue/queuedHas a queued task in the Supabase agent queue
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 29, 2026
  5. 9 remaining items

  6. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    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 Oct 31, 2026
  7. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

meta/follow-upFollow-up spun out of earlier work

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions