Repository navigation
Description
Priority P1 — order 4. Horizon: Week. Design: quota-plane-design-2026-10-26.md (usage-billing-hub goal files), Stage 2. Parent context: epic #1047. (§1, consumption)
Wire the OpenCode pools to consume quota-current for automated decisions: placement reads the fresh state (<=15-minute-old for adapter-covered pools once the gatherer is live; the measurement gate tightens accordingly); ordering = burn-by-expiry (soonest reset first, OpenAI final reserve); >=85% caution and wall exclusion applied from MEASURED values, complementing the fork's existing error-based demotion (>=3 quota errors/4h -> weight x0.01) so pools demote before errors happen. Never-funds rule unchanged: a walled plan pool rotates or stops, never PAYG.
Acceptance: a placement decision demonstrably changes when quota-current changes (test or staged demo); guidance output cites the measuredAt it used.
Acceptance criteria
- OpenCode pool placement reads quota-current (<=15-minute-old for adapter-covered pools once the gatherer is live) and a placement decision demonstrably changes when quota-current changes (test or staged demo) — restating the body's Acceptance section as the criteria section.
- Guidance output cites the
measuredAtit used. - Ordering is burn-by-expiry (soonest reset first, OpenAI final reserve); measured demotion complements the fork's error-based demotion, and the never-funds rule is unchanged (a walled plan pool rotates or stops, never PAYG).
Activity
developing-today commentedon Oct 27, 2026
CODE-293
dezren39 commentedon Oct 27, 2026
REVIEW FINDING (2026-10-26, fork side): the fork's plan store (packages/core/src/model-plan.ts) is a plain-JSON file in OpenCode's data dir that "the tools here and OpenChamber read and write the same file" — plan_info is the in-session tool over it. Two facts for this issue: (1) QuotaWindow models ENTITLEMENTS (limit, windowHours, resetRule/resetAt) — it has no live "used" field; live usage is route telemetry (route_usage / model-usage), so the consumption contract must join measured usage (from the gatherer) with plan windows, not expect the plan store to hold readings. (2) Known fork bug developing-today/opencode#550: route_usage silently omits plan quota windows that have no windowHours (monthly/reset-rule windows never appear) — consumption work must not build on route_usage output for monthly windows until that is fixed.
dezren39 commentedon Oct 28, 2026
Intake review
quota-plane-design-2026-10-26.md(usage-billing-hub goal files, §1).meta/follow-upbefore this pass.priority/high. Its Acceptance line has been expanded into the appended## Acceptance criteriasection (original body preserved verbatim above it). One body detail is stale and a worker should reconcile it before implementing: the ">=85% caution" zone was retired by Drew on 2026-10-27 — pools are now used to 100%, and at a KNOWN 100% the pool is closed until reset or a fresh read shows it dropped (see the POOL MAP in the provider-quota registry). The measured-demotion intent stands; the 85% threshold does not.kind/feature,priority/high(P1 in body),effort/m,source/human,status/needs-triage,meta/enriched.dezren39 commentedon Oct 29, 2026
DREW (2026-10-29, main chat): the demotion half of this issue is now a very-high-priority requirement, stated plainly — providers whose quota is KNOWN 100% used (reset not imminent) move OUT of the routes until reset or a fresh good read pulls them back in; failing targets also come out, with a warning and a retry policy. OpenCode-side mechanism: developing-today/opencode#6 (raised to priority/critical tonight — credential.activate failover + route removal/promotion), reading the shared QuotaSnapshot contract (opencode#587, adopted 2026-10-29). This issue remains the quota-plane half: quota-current must carry the known-100% / good-again signals those moves consume.
5 remaining items
developing-today commentedon Nov 3, 2026
agent-note:v1
state: reviewed (coverage loop-back)
Coverage pass 2026-11-03, loop-back review: this issue was re-reviewed (drift / overlap / already-handled / stale / blockers / ordering) so every open issue in the four repos is reviewed and in the system. Verdict: still live; in the system as task 7207 (triage, queued, priority 50) in repo-health-code-pilot. Labels audited and synced. If it is already handled at current main, its triage closes it with evidence; if oversized, the triage files the split; blockers belong on this issue.
Found via: coverage loop-back 2026-11-03
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
3a02ea3to4371899#6Triage verdict — task 7207, verified at origin/main e425b6a (2026-11-03)
CONFIRMED STILL LIVE, with two acceptance points superseded by Drew's later quota doctrine. Re-verified fresh this run (the task 2437 verdict of 2026-11-02 stands in substance, with one correction):
quota-current.json; adapters exist inpm-stack/aggregator/src/(quota-current.ts,quota-gather-map.ts,clinepass-adapter.ts,token-adapter.ts).overlayQuotaCurrent(quota-current.ts:342) overlays it onto the /quota view (README quota table, line 473). The README's "Remaining hop: the aggregator does not read quota-current.json yet" text (line ~607) is stale — it predates the overlay; the still-missing hop is decision consumption, not display.3a02ea3to4371899#6) is CLOSED; measured placement/demotion is the part that remains.measuredAt), with the code side owing only the stale README correction above. No code-repo fix task is enqueued from this triage: the work is not in this repo, and a per-repo duplicate is exactly what the set rule forbids. Issue feat(quota-plane): OpenCode pools consume quota-current — measured placement, rotation, demotion #1157 stays open as the set's tracking home under epic issue epic(usage-hub): SaaS/cloud services completion — v2 live collectors, daily console reads, v3 reconciliation #1047.