Skip to content

fix(probe): retry stale staged replies; carry probe failures into health#106

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/103-104-probe-robustness
Jul 14, 2026
Merged

fix(probe): retry stale staged replies; carry probe failures into health#106
CameronBrooks11 merged 1 commit into
mainfrom
fix/103-104-probe-robustness

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Closes #103, closes #104 — the probe-robustness pair from the #138 bench restart-roulette.

#103 — stale staged replies are transient, not fatal

An ungracefully interrupted master leaves its last requested_opcode staged on the peripheral; the next probe's query can read that old frame back before its own SET_REPLY takes effect. The probe treated any unexpected reply opcode as fatal → device excluded until the next restart (observed twice consecutively on the bench, different victim each time — whichever slice the dying runtime was polling).

probe_device's version and caps queries now go through query_reply(), which re-issues the whole SET_REPLY round-trip up to 3 times when the reply opcode doesn't match. Re-staging is exactly the recovery the failure mode needs; a persistently wrong reply still excludes the device.

#104 — say WHY a device is missing

Bench journal showed bread already reports probe-excluded configured devices via missing_expected_ids (the "vanishes" framing in the issue was wrong — corrected there). What was missing is the reason: failed_devices said "expected device not found during startup" even when the address was probed and failed with a specific error. The probe failure now travels with the id into the readiness reason, a missing_detail health metric, and the startup log line:

missing expected device id=dcmt0 (probe failed (version_read_failed): unexpected opcode in version reply: 0x80)

The runtime-side half (provider shows AVAILABLE with missing configured devices; install health passes) is filed as anolishq/anolis#185.

Tests

ScriptedTransport gains a stale-reply queue (served ahead of the script regardless of the requested opcode — models the real staging behavior). New: stale-then-recover probes Supported; 5 stale frames exhaust the budget and exclude with the right detail; the existing unresponsive-expected-device test now asserts the propagated reason. 88/88, warnings-as-errors clean.

Two probe-robustness fixes from the #138 bench restart-roulette:

Retry stale staged replies (#103): an ungracefully interrupted master
leaves its last requested_opcode staged on the peripheral, so the next
probe's query can read that old frame back before the new SET_REPLY
takes effect. The probe treated any unexpected reply opcode as fatal
and excluded the device until the next restart - observed twice in a
row on the bench with a different victim each time (whichever slice
the previous runtime instance was polling when it was killed). Version
and caps queries now re-issue the whole SET_REPLY round-trip up to 3
times before giving up; a persistently wrong reply still excludes.

Carry probe failures into the missing-device report (#104): a
configured device whose address was probed and failed landed in
missing_expected_ids with the generic reason 'expected device not
found during startup'. The probe failure (status + detail) now travels
with the id - into the readiness failed_devices reason, a
missing_detail health metric, and the startup log line - so operators
see WHY a device is absent without the provider log. The runtime-side
visibility gap (provider AVAILABLE with missing configured devices,
install health passing) is anolishq/anolis#185.

Tests: ScriptedTransport gains a stale-reply queue; new cases cover
stale-then-recover, persistently-stale exclusion, and detail
propagation on the existing unresponsive-expected-device flow.

Closes #103
Closes #104
@CameronBrooks11
CameronBrooks11 merged commit 0cc259d into main Jul 14, 2026
11 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/103-104-probe-robustness branch July 14, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant