You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opencode-route-proxy: known-100% seating gate — exclude legs whose binding quota window is known exhausted until reset (#4370c) #5295
opencode-route-proxy: known-100% seating gate — exclude legs whose binding quota window is known exhausted until reset (#4370 acceptance (c))
Implementation slice scoped by triage task 8950 (lane W, 2026-11-04) extending #3325 leg-shedding to the #4370 death classes. Findings and full evidence are on #3325 (task 8950 comment) and #4370.
Problem (verified at main, blob 70f01618, bin/opencode-route-proxy.mjs, 1095 lines)
Seating has no known-100% gate. demotedPairs (lines ~330–345) learns only from the attempt ledger (≥3 quota failures in 4 h), and applyDemotion (lines ~662–670) reorders demoted pairs to the back — it never excludes them.
Fail-safe: if exclusion would empty the route, keep current demoted order rather than hard-failing; record the gate decision in existing diagnostics.
Tests with the pinned-now clock (OPENCODE_ROUTE_PROXY_NOW_MS): known-100% pair excluded while a live pair exists; pair returns after reset; all-exhausted route still walks in demoted order.
Out of scope: external quota-service reads at request time, demotion threshold changes, transport timeouts (companion slice), in-stream shedding (task 8932).
Implemented:knownExhaustedPairs + applyKnownExhaustedGate in bin/opencode-route-proxy.mjs — a pair whose latest quota-bearing ledger failure carries a future reset (Retry-After-derived or absolute) and no later success is excluded from candidates after demotion; fail-safe keeps the demoted order when exclusion would empty the route; decisions logged to the proxy's stderr diagnostics; clock via nowMs() so OPENCODE_ROUTE_PROXY_NOW_MS pins it.
Verified on the laptop:node --test bin/opencode-route-proxy.test.mjs — 31/31 pass, including 4 new pinned-clock tests (exclusion with ledger extract, return after reset, all-exhausted bypass, success-clears-gate). This issue closes via the PR's Fixes #5295 on merge.
Delivered: the known-100% seating gate in bin/opencode-route-proxy.mjs (#4370 acceptance (c)): pairs whose latest quota-bearing ledger failure carries a future reset and no later success are excluded at seating time; fail-safe keeps the demoted order when no credentialed candidate survives; decisions on the proxy's stderr diagnostics; clock via nowMs().
Verification:node --test bin/opencode-route-proxy.test.mjs — 34/34 on the laptop, including 7 new pinned-clock gate tests. Codex review: three rounds — credential-aware fallback (P2), receipt-anchored Retry-After (P2), completion-time ordering (P2) — all fixed with regression tests and replied on-thread; final round completed with no findings.
Activity
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up → PR opened (task 9239)
queue/9239-5295-known100-gate, commit8f0bef24e)Implemented:
knownExhaustedPairs+applyKnownExhaustedGateinbin/opencode-route-proxy.mjs— a pair whose latest quota-bearing ledger failure carries a future reset (Retry-After-derived or absolute) and no later success is excluded from candidates after demotion; fail-safe keeps the demoted order when exclusion would empty the route; decisions logged to the proxy's stderr diagnostics; clock vianowMs()soOPENCODE_ROUTE_PROXY_NOW_MSpins it.Verified on the laptop:
node --test bin/opencode-route-proxy.test.mjs— 31/31 pass, including 4 new pinned-clock tests (exclusion with ledger extract, return after reset, all-exhausted bypass, success-clears-gate). This issue closes via the PR'sFixes #5295on merge.fix(route-proxy): Codex round on #5295 — credential-aware gate fallba…
fix(route-proxy): Codex round 2 on #5295 — order gate observations by…
Merge pull request #5296 from developing-today/queue/9239-5295-known1…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done (task 9239)
9c8f91e48477c7908f55bf50ce5fff3c9ee87414; this issue closed by itsFixes #5295.Delivered: the known-100% seating gate in
bin/opencode-route-proxy.mjs(#4370 acceptance (c)): pairs whose latest quota-bearing ledger failure carries a future reset and no later success are excluded at seating time; fail-safe keeps the demoted order when no credentialed candidate survives; decisions on the proxy's stderr diagnostics; clock vianowMs().Verification:
node --test bin/opencode-route-proxy.test.mjs— 34/34 on the laptop, including 7 new pinned-clock gate tests. Codex review: three rounds — credential-aware fallback (P2), receipt-anchored Retry-After (P2), completion-time ordering (P2) — all fixed with regression tests and replied on-thread; final round completed with no findings.Claim labels cleared with this note.