Skip to content

fix(serving): a self-heal must say WHY — the wedge reason reaches the snapshot, not just the log - #3725

Merged
joelteply merged 1 commit into
canaryfrom
fix/wedge-heal-names-its-reason
Sep 5, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/wedge-heal-names-its-reason

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Three sites in serving_daemon had a failure reason in hand and published
ServingSnapshot::empty() — which hardcodes degraded_reason: None. They now publish
ServingSnapshot::degraded(reason).

The worst is declare_lane_wedged: it takes the reason as a parameter, logs it, and
then drops it from the surface.

Site Before After
declare_lane_wedged reason: &str → log only published on the snapshot
model-resolver failure probe named the unresolvable id, snapshot didn't names the model id
no servable model on disk silent empty() — a fresh install looks broken names it, points at models/pull

Why — measured, not inferred

BigMama, core bb7141f83, 2026-09-04:

03:01:14Z  flipped serving snapshot not-ready — reconcile will kill+respawn the wedged lane (#175 self-heal)
03:01:20Z  serving plan recomputed  lanes=2 resident=1      <- teardown dip
03:01:24Z+ spawn-at-transient guarded: successor floored... <- #363 floor doing its job
03:02:36Z  llama-server spawned, --parallel 3               <- healthy successor

Throughout that window serving/status reported ready:false, active_model:null, lanes:0, degraded_reason:null — absence with no stated cause, byte-identical to a node
that never had a brain. I hit that state three times in one night and twice got as far as
drafting a defect against a system that was correctly healing itself in front of me.

The pre-flight guard already reserves a degraded= field on its probe for exactly this
string — added 2026-08-15 with the note "every turn of a round waited here for 120s each
while serving/status knew the exact cause and nothing surfaced it"
— and was being handed
"" on every wait. The field's own doc carries the same lesson from a 2026-07-24 Windows
repro. This is the third time the same defect has been written up; the reason was simply
never wired at these three call sites.

Safety

ServingSnapshot::degraded(r) is {degraded_reason: Some(r), ..empty()}, so this is
additive to the surface only:

  • ready stays false, active_model stays None → is_live() unchanged
  • force_relaunch still arms → the self-heal is untouched
  • wedge_heal_floor reads live_ready (still false) → unchanged
  • the last_healthy_* latch gates on ready && window > 0 → unchanged

Checked every consumer of degraded_reason — none branch on is_some():
serving_guard.rs:196 only stamps it onto a probe string; positron_serving_source.rs:316
clones it into the ViewState. So populating it cannot suppress a respawn.

Existing a_reported_wedge_flips_the_lane_not_ready (regression for the 4.1-hour /
172 GB-log outage) asserts ready == false and force_relaunch == true — both still hold.

Test

One test, in the existing mod tests, asserting both halves: the reason reaches the
snapshot verbatim AND the relaunch control path is unchanged — so a future refactor can't
buy the message back by breaking the heal.

test modules::serving_daemon::tests::declaring_a_wedge_publishes_the_reason_not_a_bare_empty_snapshot ... ok
test result: ok. 1 passed; 0 failed

Validation status — please let CI be the gate

Locally verified: clean compile, and the new test passes by name (not filtered away).
I also read the tests covering the changed path rather than assuming.

The full --lib suite did not complete locally and I am not claiming it green. This
box is 64.9 GB with the citizens' llama-server resident at 39.3 GB; rustc's codegen peaks
around 7–10 GB, and runs were killed at that peak with no stated cause ([killed]) until
I dropped debug info. No test failures appeared before the stop — but "no failures
observed" is not "suite green", so CI should be trusted over me here.

Filed separately from this branch, both measured on the same node:

  • dbebed58 — serving/status published lanes:2 on a ready snapshot while argv said --parallel 3 for ~2.7 min
  • a3d5421a — the #363 floor probe announcing a guarded successor on ticks where no process is spawned

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

… snapshot, not just the log

`declare_lane_wedged` TAKES the failure reason as a parameter, logs it, and then
published `ServingSnapshot::empty()` — which hardcodes `degraded_reason: None`. So for
the whole kill+respawn window `serving/status` read `ready:false, active_model:null,
lanes:0, degraded_reason:null`: absence with no stated cause, byte-identical to a node
that never had a brain.

Measured live on BigMama 2026-09-04 (core bb7141f). The daemon declared a wedge at
03:01:14Z, knew the reason, published an empty snapshot, and brought a healthy successor
up at 03:02:36Z. In between, the surface said nothing — and I read that same state three
times across the night as a possibly-dead serving lane, twice getting as far as drafting
a defect for a system that was correctly healing itself in front of me.

The pre-flight guard already reserves a `degraded=` field on its probe for exactly this
string (added 2026-08-15: "every turn of a round waited here for 120s each while
serving/status knew the exact cause and nothing surfaced it") and was being handed ""
on every wait.

Three sites had the reason in hand and threw it away:
  - `declare_lane_wedged` — the reason is a PARAMETER; now publishes `degraded(reason)`
  - model-resolver failure — the probe named the unresolvable id, the snapshot did not
  - no servable model on disk — the state a fresh install sits in before any weights are
    pulled, previously indistinguishable from a broken daemon; now names itself and
    points at `models/pull`

Behaviour is unchanged: `ServingSnapshot::degraded(r)` is `{degraded_reason: Some(r),
..empty()}`, so `ready` stays false, `active_model` stays None, the `force_relaunch`
self-heal still arms, and `wedge_heal_floor` / the `last_healthy_*` latch (which gate on
`ready && window > 0`) are untouched. Verified no consumer branches on
`degraded_reason.is_some()` — `serving_guard.rs:196` only stamps it on a probe,
`positron_serving_source.rs:316` clones it into the ViewState. This is additive to the
surface only.

Test asserts both halves: the reason reaches the snapshot verbatim AND the relaunch
control path is unchanged, so a future refactor cannot buy the message back by breaking
the heal.

[[absence-rendered-as-positive-fact]] [[fallbacks-are-illegal-fail-loud]]

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply
joelteply merged commit 3c9637a into canary Sep 5, 2026
5 checks passed
@joelteply
joelteply deleted the fix/wedge-heal-names-its-reason branch September 5, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant