Adds an atomic degraded-until state (health.go: IsDegraded/MarkDegraded/ MarkHealthy) that lets request handlers fail fast with a clear unavailable error instead of blocking on xcecli's own ~100s retry budget when the backend is known-degraded. Consolidates what tasks 4.3/4.4 left as duplicated inline "call xcecli_*; checkAndPerformRejoin()" pairs across five wrapper functions into one shared callBackend() helper: checks IsDegraded() before every call (fail fast, skip the C call and the rejoin check entirely on the degraded path -- checking rejoin there would itself block up to ~100s, defeating the fail-fast purpose), marks degraded on -E_XCE_NOT_READY, marks healthy at checkAndPerformRejoin()'s existing success point (the single call site both the write path and the idle-period heartbeat path already funnel through). The circuit breaker's own TTL-based state is deliberately never read by the rejoin-retry mechanism -- checkAndPerformRejoin() has no IsDegraded() dependency, so a fast-fail window never suppresses retry-until-actually-joined; heartbeat.go's unconditional per-tick call keeps that cadence alive regardless of degraded state, and a 10s TTL (well under the ~100s retry budget) lets write traffic resume contributing once it clears. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NNB4zGPCsHyDUCDJyMbiQN |
||
|---|---|---|
| .. | ||
| settings | ||
| specs | ||
| steering | ||