Commit Graph
8 Commits
Author SHA1 Message Date
Ettore Di Giacinto 798f6c5105 fix(failover): spill capacity and disabled targets without tripping them
An admission rejection or a disabled target moves the request to the
next target through Attempt.Skip, which records no failure. A 4xx
response no longer counts as a success. Requests skip body recording
when no chain is configured, and stop it once the model is known not
to be a chain.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 17:24:53 +00:00
Ettore Di Giacinto 8a0bf410ee feat(failover): run the chain manager and keep warm targets loaded
Warm local targets are pinned in the watchdog and preloaded. Switches
and target health are exported as metrics, skipped attempts as traces.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 16:06:15 +00:00
Ettore Di Giacinto f45bb1aa41 feat(failover): probe remote targets over HTTP and local ones over gRPC
Remote liveness uses /v1/models, which every OpenAI-compatible upstream
serves. Recovery sends one minimal request for the target's usecase.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:55:43 +00:00
Ettore Di Giacinto 86a9597893 feat(failover): schedule liveness and recovery probes
Idle targets get a liveness probe each interval, recovering targets an
inference probe. Cold local targets are never loaded to be probed.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:48:05 +00:00
Ettore Di Giacinto b403a8e1c6 fix(failover): emit chain.switched when leaving degraded in place
recomputeLocked only fired the event on an active-target change or on
entering degraded. When the active target itself recovered while every
target was down, the chain silently left degraded with no event, so
SSE/realtime consumers tracking chain.switched.state got stuck on
"degraded".

Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:45:41 +00:00
Ettore Di Giacinto 5601692f55 fix(failover): satisfy lint on the manager package
errcheck flagged two side-effect-only m.Plan calls in tests, and unused
flagged close(), which Task 5's probe scheduler wires in.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:41:24 +00:00
Ettore Di Giacinto 929085a030 feat(failover): add chain manager with trip, fail-back and pins
Health is tracked per target and the active target per chain. Fail-back
waits for recovery probes and a minimum time on the fallback.

Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:40:35 +00:00
Ettore Di Giacinto e13e7ea8fa feat(failover): add types and retryable error classification
Assisted-by: Claude:claude-opus-5-5
2026-09-26 15:35:47 +00:00