Skip to content

fix(router): suppress persistent target failures under sparse traffic - #20

Merged
danialranjha merged 2 commits into
mainfrom
fix/issue-17-sparse-429-20261016
Nov 4, 2026
Merged

danialranjha merged 2 commits into
mainfrom
fix/issue-17-sparse-429-20261016

Conversation

@danialranjha

@danialranjha danialranjha commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Fixes #17.

A target returning 429 once every few minutes never accumulated three failures inside the old one-minute circuit window. A successful sibling model also reset the shared provider counter, so the failing target kept returning to rotation.

Track consecutive operational failures by provider, model and configured auth identity across idle gaps and routes. After three failures, apply capped 2m → 5m → 30m → 2h cooldowns, preserve longer reason-based deadlines, and admit one on-demand recovery probe. Success resets that target's history; sibling successes do not. Blocked targets are excluded from the healthy list.

The implementation keeps current main's routing-scope lifecycle guards while admitting attempts through the per-target cooldown/probe permit. The issue's separate excluded-provider candidate-trace note remains deferred.

Review and validation

  • Exact reviewed head: df4c66da7d42978096e91ba529fe3f65cf5b50b4.
  • npm run check: passed.
  • Focused circuit/operational regressions: 28 passed.
  • Session lifecycle/cache regressions: 33 passed.
  • Full npm test: 553 passed, 0 failed.
  • Mutation guard, scope check, whitespace check, and conflict-marker check passed.
  • Independent final source review approved with no blocking findings.
  • Exact-head GitHub CI validate passed: https://github.com/danialranjha/pi-auto-router/actions/runs/40322918081.

Merge-safety verdict

Safe to merge. Residual risks are non-blocking: concurrent failures already in flight may escalate cooldown faster than the README's recovery-probe wording suggests; operational classification remains message-based; live paid-provider/zero-limit behavior was not exercised.

Visual review artifact

The self-contained HTML review is prepared as show-me-pr20-review.html. Orca public artifact sharing is disabled on the coordinator device, so a public artifact URL could not be minted; enable Settings → Artifacts → “Allow publishing public artifact links” to publish it.

Hosted preview QA is not applicable: this is a Pi CLI/router extension with no hosted application or preview deployment.

Track consecutive operational failures by provider/model/auth identity across
idle gaps, preserve longer reason deadlines, and admit one recovery probe with
capped 2m/5m/30m/2h escalation. A successful sibling no longer resets the failing
target. Preserve abort, signature, auth/input and partial-output behavior.

Reuse the previously validated eight-file issue #17 patch unchanged. Add a
read-only PR CI validate job on Node24 for locked install, typecheck and tests;
pin official checkout/setup-node actions and disable persisted credentials.

Validation: targeted 28 circuit/operational regression tests passed; reviewed
CI proposal YAML/scope and mutation guard passed; exact explicit staged paths
reviewed. Postcommit project checks, independent exact-source review and remote
CI are required before delivery completion.

Task: task-issue17-draft-pr-delivery-20261016 (T1).
Limits: in-memory health state and message classification; no live Mistral quota
or paid-provider test, hosted preview, merge or deployment.
@danialranjha
danialranjha marked this pull request as ready for review October 16, 2026 18:08
@danialranjha
danialranjha merged commit f5669fe into main Nov 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persistent 429 (zero rate limit) target is never taken out of rotation: circuit breaker window never fills under sparse traffic

1 participant