#7849·omnigent

[Test / Refactor] Runner status probe: cover the transport-error branch and make in-flight tracking runner-aware

Author: dbczumarCreated Sep 19, 2026Updated Sep 20, 2026
LabelsBugcomp:servercomp:runnerP2-mediumtriagedvalidated:not_reproduced

Description

Follow-ups from the review of #7826 (runner status probe in _get_session_snapshot, omnigent/server/routes/_sessions/orchestration.py), both non-blocking there:

  1. Transport-error branch has no direct test. _run_runner_status_probe treats httpx.HTTPError / ConnectionError like a timeout (failure string, skip window, one WARNING), but the unit suite only drives the timeout, slow non-200, malformed 200, prompt 404, concurrency, cancellation, doubling, reset and rebind paths. Add a fake runner raising httpx.ConnectError and assert both concurrent callers receive None, the next snapshot skips the probe, the in-flight entry is cleared, and the skip window is recorded.

  2. Rebind during an in-flight probe joins the old runner's probe. _probe_runner_live_status checks _runner_status_probe_inflight before comparing the skip window's runner id, so a snapshot arriving after a rebind while the previous runner's probe (up to 5 s) is still pending awaits that probe and may cache the old runner's status until the relay publishes. Make in-flight tracking runner-aware (key or tag the task by runner id and start a fresh probe when the bound runner differs) and add coverage for a rebind while a probe is pending.

Expected behavior

  • A transport failure on the probe is covered by a test that pins the shared fallback, the skip window, and in-flight cleanup.
  • A snapshot after a rebind never awaits or caches a result from the previous runner's probe.