Repository navigation
fix(broker): log the whole error chain when a worker fails to spawn - #1973
Conversation
On fleet node sf-frame, `claude` spawns end with "failed to spawn worker"
about 5ms after start. The log line formatted the anyhow error with
Display, which prints only the outermost context, so the OS error from
Command::spawn that says why the spawn failed was dropped.
Format it with `{:#}` through a small helper, and pin the helper with a
test that the io::Error survives.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
…r-chain # Conflicts: # CHANGELOG.md
Why
On fleet node sf-frame,
claudespawns fail with onlyfailed to spawn workerabout 5ms after start (crates/broker/src/worker.rs:1670,command.spawn().context("failed to spawn worker")). Example fromsf-frame.log.2026-10-12:relaycast_events.rslogged theanyhow::Errorwith Display (%e), which prints only the outermost context. The OS error that explains the failure (for exampleNo such file or directory) was dropped. The fleetaction.resultalready uses{error:#}, but on that node those results are rejected withd1_pressure, so the log line is the only place the cause would appear.Change
The log line and the
eprintln!now use{:#}, through aspawn_failure_detailhelper. This changes log output only. Behaviour is unchanged.Verification
Mutation check. I changed the helper to
format!("{error}"):After restoring it (
cmpidentical), the test passes again.cargo fmt --checkandcargo clippy -p agent-relay-broker --lib -- -D warningsare clean.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Logging-only change in one error path; no spawn, dispatch, or control-plane behavior is modified.
Overview
Relaycast WebSocket worker spawn failures now log the full
anyhowerror chain instead of only the outer context stringfailed to spawn worker.The
tracing::error!line and matchingeprintln!inrelaycast_events.rsgo through a smallspawn_failure_detailhelper that formats with{:#}, so operators see underlying causes (for example a missing binary /NotFound) when fleet action results are unavailable. Spawn behavior and error propagation are unchanged.CHANGELOG documents the fix under Fixed.
Reviewed by Cursor Bugbot for commit aca562f. Bugbot is set up for automated code reviews on this repo. Configure here.
Agent Relay sessions
claudesessiona8232a06· opened viagh pr create· last active 2026-10-13