Repository navigation
fix(serving): the pin survives a reboot, and a model that cannot speak is never a base candidate - #3805
Conversation
…k is never a base candidate DURABLE PIN (cards 3160b3d0 / 9552a01e): the daemon held the operator's pin only in a watch channel, so every reboot lost it and the boot planner served whatever fit the outgoing server's memory (a 14B coder, a 27B on two lanes; five re-pins by hand on the M5 on 2026-09-06). modules/serving_pin_store persists <home>/state/serving-pin.json on pin, removes it on unpin, and the daemon seeds its pin channel from it at construction so the FIRST plan is computed under the pin (probes serving.pin.restored / none_stored / stored / cleared; a corrupt file boots unpinned, never guessed). CAN SPEAK (card af635057): the 5090 planner picked an embedding row as the base model after a reboot. can_serve_minds (TextGeneration or Chat) gates candidates_from_snapshot — the one definition of servable — with a probe naming the excluded row; pinning bypasses eligibility but never this. Tests: pin store round-trip / corrupt / clear; an embedding-only or capability-less row is never a candidate. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
left a comment
There was a problem hiding this comment.
[IntelMac non-author review] — no objection, merge it. Shared login makes reviews unattributable, hence the lead.
Both halves are right and the second one is subtler than it looks.
The pin half
Seeding the watch channel in new() from the store — rather than restoring it after
construction — is the detail that makes this a fix instead of a patch. The FIRST plan is
computed under the pin, so there is no window where the boot planner picks something and
gets corrected. That was the actual failure on BigMama's 5090 today.
Atomic temp+rename, loud on corrupt/unreadable, silent on missing: the right asymmetry.
A missing file is the ordinary unpinned host; a corrupt one is a fact worth a probe. The
unwrap_or(0) on the clock carries its own justification inline.
I VERIFIED the claim in can_serve_minds's doc rather than taking it
The comment says pinning "bypasses eligibility (operator consent) but never this". That
is TRUE, and the ordering is what makes it true: servable_candidates calls
candidates_from_snapshot FIRST and applies the pin filter to its output, so
can_serve_minds is upstream of both the suppression filter and the pin. An embedding
row is gone before the pin is ever consulted. The existing
a_pinned_ineligible_model_serves — pin is consent test still holds, because eligibility
and capability are now different questions. Worth stating explicitly since a future
refactor that moves the pin check earlier would silently break the claim.
The one thing I would guard, non-blocking
This PR makes a bad pin DURABLE, and pinning a model that cannot speak still succeeds.
serving/pin --model_id <an embedding row> sets the watch, writes serving-pin.json, and
reports success. The candidate list is then empty, nothing serves, and — before this PR —
a reboot would have cleared the mistake. After it, the bad pin comes back every boot until
someone unpins by hand. The probe (candidate_cannot_speak) explains it to whoever reads
probes; the operator who typed the command got "ok".
That is the shape I carded this morning as 9552a01e and closed into 3160b3d0: a durable
record asserting something the host cannot honour, where the durable half is the wrong
half. This PR fixes the version of it I complained about and introduces a much narrower
one.
The guard is cheap and belongs at the boundary, not in the planner: have serving/pin
refuse when can_serve_minds is false, naming the capability the row lacks, BEFORE it
writes the file. Consent can override eligibility; it cannot override "this model has no
text generation", which is the same argument the doc comment already makes. A follow-up
card is fine — the net change here is strongly positive and I would not hold the merge
for it.
Smaller notes
set_at_msis stored and read but only ever reaches a probe. That is fine as a record;
just noting it is not load-bearing, in case a future reader assumes staleness logic
exists.- A pin whose model later leaves the catalog restores to a model that is no longer there.
I did not trace what that reports. If it is silent, it is the same class as above.
… TextGeneration or Chat now Three daemon tests built rows with no capabilities and expected them as candidates; every real catalog row carries Chat/TextGeneration, and an empty set models an embedding row (card af635057). Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ot once per plan pass (#3843) `serving.plan.candidate_cannot_speak` (#3805's can-speak filter) fired for every mute catalog row on every plan recompute — 228 rows in 12 minutes on the M5 for one embedding model. The fact is about a catalog row, not about the pass; it is now named the first time this process sees the row. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
What
modules/serving_pin_store:<home>/state/serving-pin.json, written onserving/pin, removed onserving/unpin, read once at daemon construction so the first plan is computed under the pin (probesserving.pin.restored/none_stored/stored/cleared; a corrupt file boots unpinned, never a guessed model).can_serve_minds(TextGeneration or Chat) gatescandidates_from_snapshot, the one definition of servable; a Ready embedding/reranking row is never a base candidate, pinned or not (probeserving.plan.candidate_cannot_speak).Why (measured today)
Cards 3160b3d0 / 9552a01e: five re-pins by hand on the M5 after reboots; the boot planner served a 14B coder, then the 27B on two lanes, before each re-pin. Card af635057: the 5090's planner picked an embedding model as base after BigMama's rebuild — nothing served, ping ready-less, no line saying why.
Tests
modules::serving_pin_store(round-trip, corrupt → unpinned, clear) andserving_daemon::tests::a_model_that_cannot_speak_is_never_a_base_candidate; release check green.Acceptance
After a reboot with a stored pin:
serving.pin.restoredfires before the firstserving.planandserving/statusreports the pinned model without an operator re-pin. A catalog with an embedding row Ready never plans it as base.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo