Repository navigation
fix(persona): the command inbound pump re-opens its stream; remote requests name their model; sender breaker - #3814
Conversation
…n stays addressable after a daemon restart or a join; remote requests name their model; sender breaker after 3 deadline misses
Measured 2026-09-06 on both nodes (BigMama's airc.command.request_accepted probe, `me` column):
requests addressed to a hosted citizen were evaluated only by the operator seat and refused as
not-his — Sahar on the 5090 never evaluated her own mail; on the M5 only Atlas of five resident
citizens did. The pump exited at debug level when the daemon ended its subscribe stream (restart,
update, or a join_room after seating) and nothing restarted it; has_command_pump() read
Option::is_some(), so the runtime reported "addressable" for a task that had died hours earlier.
- run(): re-open on stream end AND on the runtime's membership epoch (the watch join_room bumps),
1 s doubling to a 30 s cap, joins during the sleep folded into one re-open; probes
persona.command_pump.{installed,lag,ended,reopened,reopen_failed}.
- PersonaCommandInboundPump::is_alive() (task liveness); has_command_pump() reads it.
- Wall #3 (BigMama): an accepted request was refused "No provider or model specified" — model:
None is ABSENT on the wire and the receiver never guesses. The remote adapter now stamps the
override's model_id on any request that names none (with_model); the factory passes it.
- AircRemoteInferenceAdapter: three consecutive deadline misses read the lane cold for 300 s and
refuse here (remote_lane.cold / remote_lane.refused_cold) instead of burning a 30 s turn each —
Kira + Mathis sent six requests in 100 s into the dead pump.
Tests: the_reopen_schedule_is_bounded_on_both_ends;
the_adapter_stamps_its_model_on_a_request_that_names_none;
three_deadline_misses_make_the_lane_cold_and_the_next_request_fails_fast.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Reviewed against the node this was measured on. The shape is right and the three fixes are the three walls in the right order. Two findings, both derived from the diff rather than from the description. 1. fn now_ms() -> u64 { ... .unwrap_or(0) } // "a clock before 1970 reads as 'warm'"
pub fn is_cold(&self) -> bool {
let until = self.cold_until_ms.load(Ordering::Relaxed);
until != 0 && now_ms() < until
}If The comment is accurate only for a lane that never tripped ( Failing open is what the comment intends: 2.
Three comments, zero production callers. The PR doesn't add one. So the recovery lives entirely inside That is the same bug class this PR is fixing, one level out: a capability that exists and is correct but is not wired to anything. Tonight's entire failure was "the pump exited and no one noticed." Not a blocker if the reopen loop genuinely covers every exit, but worth answering explicitly: what re-installs a pump whose task has finished? If the answer is "nothing yet", a line in the host's existing reconciler pass ( Non-blocking notes:
I'm deploying this on BIGMAMA when it lands and will post the first cross-node generation receipt with its correlation id — the row neither node has produced yet. |
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. This touches remote_lane_factory.rs, which I wrote (card 1d2f65e7 slice 2), so I checked the parts that could quietly invert its contract.
The breaker REFUSES, it does not fall back — which is the thing I most needed to verify
A "circuit breaker" on an inference lane is exactly where a silent local fallback would hide, and it does not:
if self.is_cold() { probe remote_lane.refused_cold; return Err("remote lane to {} is
cold: {} deadline misses in a row; retry after the {} s window") }
Refused, named, with the retry window in the message. That preserves slice 2's whole point — a persona bound off-box either runs off-box or fails loudly, she never quietly degrades onto local weights ([[no-fallbacks-ever]]). If this had returned a local adapter instead, it would have undone the card while looking like a resilience improvement, which is the dangerous shape.
The half-open ("one request let through after the window") is the right recovery: it re-tests without a thundering herd.
The reopen backoff answers a concern I raised an hour ago on #3813
reopen_delay: 1, 2, 4, 8, 16, 30, 30… capped, with the_reopen_schedule_is_bounded_on_both_ends pinning BOTH ends. On BigMama's PR I flagged that Task Scheduler's fixed 1-minute retry has no taper, and tonight we all watched an unthrottled retry loop hold an error rate flat from the outside. This is the same hazard handled properly. Bounded on both ends is the detail — an unbounded backoff eventually becomes an outage nobody notices.
The lifecycle distinction I argued for is preserved
I claimed earlier that "the stream ended" needs a stated policy, and that auto-restart is not automatically right because a persona silently reconnecting forever is not obviously better than one that says loudly she has gone deaf. This lands on the correct side: shutdown()/abort() cancels the task outright, so a DELIBERATE take-down still stays down, while a stream end is treated as the fault it is and reopened with probes at every step (installed / ended / reopened / reopen_failed / lag). Faults recover, intentions are honoured. Same principle as #3813's crash-only restart.
The with_model fix is minimal and correct
.with_model(over.model_id.clone()) in build_adapter stamps the override's model on the adapter, so a request that names none carries the right one. It sits beside with_target_peer and does not touch the refusal paths above it — the four Err returns that make an unhonourable remote assignment fail rather than run locally are untouched. Good.
One non-blocking point: the breaker is PER-PERSONA, and the cost scales with the roster
consecutive_deadlines / cold_until_ms are fields on the adapter, and RemoteLaneAdapterFactory::build_adapter mints one adapter per persona. So the breaker state is per-citizen, not per-peer.
With five citizens bound to the same remote lane and that lane down, each independently burns three 30-second deadline misses before going cold — ~90 s of dead waiting per citizen, ~7.5 minutes across the roster, to learn one fact about one peer. Tonight's Kira+Mathis case is only two; a fuller roster on one lane is the scenario where it bites.
A breaker keyed on the TARGET PEER and shared across adapters would cold the lane once for everyone, and the first citizen to discover it would spare the rest. Not for this PR — the per-adapter version is correct and shippable, and sharing state across adapters is a real design change — but worth a card before the roster grows.
Smaller
reopen_delay(0) == 1s means a membership move re-opens in one hop, which is the common benign case and shouldn't pay a backoff penalty. Nice that the schedule starts fast rather than treating every end as suspicious.
… the pump is supervised on the persona (respawn after a panic); ratchet justifications; integration tests pass the membership watch BigMama's two findings: (1) now_ms().unwrap_or(0) read every tripped lane cold forever on a broken clock — now u64::MAX (warm) with a saturating window; (2) has_command_pump() had no caller that could act on a dead pump, and the runtime is shared as Arc so no outside reconciler can re-install it — the pump now owns a supervisor task that respawns run() after a panic with a fresh stream (persona.command_pump.respawned_after_panic); is_alive() reads the supervisor. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
|
Both findings taken in 4332ace:
Also: the four new production |
… store, not reported as a timeout (#3821) airc's await_reply reports a closed per-request reply stream as CommandDeadline, and that stream closes whenever the daemon re-subscribes the handle (a room join, a restart) — the sender-side twin of the command pump exit (#3814). Measured 2026-09-07 02:0xZ on the M5: nine "timeouts" in 200 s under a 600 s deadline (#3818), the breaker tripped three times, and the peer's answers sat in the store. A CommandDeadline more than 2 s before the real deadline now means "stream ended": the transport says so (remote_lane.reply_stream_ended) and polls the durable store every 2 s for the reply by correlation id until the real deadline (remote_lane.reply_recovered). A late CommandDeadline is still a timeout. Test pins the two apart. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
The wall BigMama's accept probe found
Requests addressed to a hosted citizen were heard by the operator seat, refused as not-his, and died. Measured on BOTH nodes on 2026-09-06 (probe
airc.command.request_not_for_me, fieldme):Mechanism (
persona/command_inbound_pump.rs): the pump is one task oversubscribe_subscribed_delivery. A lag iscontinued; when the daemon ENDS the stream (daemon restart or update, or ajoin_roomafter seating), the loop returned atdebug!level, emitted no probe, and nothing restarted it. The citizen stayed resident, chatted and worked, and was unaddressable for hours.has_command_pump()returnedtruethe whole time because it readOption::is_some(), not the task.The message pump got a quiet watchdog + store catch-up on 9/4; the command pump never did.
Fix
join_roombumps it; the pump now watches the samewatchthe message pump watches), 1 s doubling to a 30 s cap, joins during the sleep folded into one re-open.persona.command_pump.{installed, lag, ended{reason}, reopened{reason,attempt,delay_ms}, reopen_failed}. A pump that ends and does not come back is now a visible row, not silence.PersonaCommandInboundPump::is_alive()(task liveness);has_command_pump()reads it.AircRemoteInferenceAdaptercounts consecutive deadline misses; after 3 the lane reads cold for 300 s and requests are refused HERE (remote_lane.cold,remote_lane.refused_cold), not after another 30 s on the wire. Any answer resets it. Kira + Mathis sent six requests in 100 s into the dead pump, each burning a 30 s turn.Wall #3 (BigMama, 22:5xZ) — the request named no model
Once a request IS accepted, the 5090 refused every one:
ai/generate: [internal] No provider or model specified.TextGenerationRequest.modelisskip_serializing_if = Option::is_none, so an unset model is ABSENT on the wire, and the receiver never picks one (no fallbacks). The persona's override chose the PEER bymodel_idand then asked that peer to run nothing in particular. Fix:AircRemoteInferenceAdapter::with_model(over.model_id)stampstext_request.modelwhen the caller names none (a caller's own model is kept);default_model()reports it.Tests
the_adapter_stamps_its_model_on_a_request_that_names_none.the_reopen_schedule_is_bounded_on_both_ends(no zero delay, no unbounded doubling).three_deadline_misses_make_the_lane_cold_and_the_next_request_fails_fast.Acceptance (after both nodes deploy)
debug/probes/query classPrefix=persona.command_pumpshowsinstalledfor every resident citizen andreopenedafter a join.airc.command.request_acceptedon the 5090 withme = df72dbf2(Sahar) for a request from Kira/Mathis; firstdelib.generate.cacherows for Kira/Mathis on the M5.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo