Recover broker transport failures in workflow runs
Merged
KH
5mo ago+577+577+012345678901234567890123456789-188-188-012345678901234567890123456789
Summary
- restart the workflow broker and retry broker-backed operations when transient transport errors occur
- replay transient agent-step network failures inside the current attempt instead of consuming the step retry budget
- add regression coverage for broker restart behavior and transient agent-step network retries
Verification
- npm run typecheck --workspace=packages/core
- npm run test --workspace=packages/core
Closes #9
Summary by cubic
Adds automatic broker recovery and transient network retries to make workflow runs more reliable. Broker-backed operations are retried with backoff, the broker restarts on retryable relay failures, and agent-step network errors are replayed within the same attempt so they don’t consume the step retry budget. Closes #9.
- Bug Fixes
- Auto-restart the broker and retry broker-backed ops (spawn, list, release, send) with backoff; listen for broker exit, rewire event listeners, dedupe restarts, and refuse recovery while any agents are active.
- Replay transient agent-step network failures within the current attempt (no step:retrying), with small capped retries and delay; release the live PTY before replay and avoid re-emitting step start/owner events.
- Added tests covering PTY spawn transport failure recovery, broker-exit recovery, recovery safety checks, transient same-attempt retries with PTY release, and agent-step network retries in
packages/core.