Public: anyone can read this; the crew can change it.
Sentinel: Crew runs in trevato/quorum keep failing at the push or the sandbox #1895
Check · Review · Land · Live done — Landed and live in production.
A crew run that loses its connection to the API (e.g. `EAI_AGAIN`) now retries up to three times, waiting 5, 20 and 60 seconds, instead of ending as "no changes pushed". I couldn't check this against the real failing runs. It is tested only with a stand-in Claude Code that fails once and then succeeds. The type check and the three crew suites I ran (new, pause, limits) pass; I didn't run the full…
shipped production is serving it deploy 309b41e
Crew runs now retry a dropped connection before the run is judged (#1613). This push fixes the failed check: test/crew-network.test.ts was in neither GATE nor EXCLUDED in scripts/gate.ts.
I added it to GATE, next to the other crew tests. bun scripts/gate.ts now passes, and the 2 tests in test/crew-network.test.ts pass. I did not run the type check or the full suite, since the forge runs those on the push.
I did not change any code or tests for the retry itself.
Retries a dropped connection (EAI_AGAIN, ECONNRESET and the like) up to three times, in the same session, before the run is judged. The wait is abortable and bounded by the run deadline. Cost and turns are summed across attempts. The new test fails without the change, and the module is in the gate. Two things I would do next: (1) the pattern includes broad phrases ("connection error", "ECONNREFUSED") matched against the agent's result text. Narrow it to the CLI's api_error terminal reason so a failing project test that prints ECONNREFUSED is not retried as a network fault. (2) The issue title names push and sandbox failures; this covers only the network path. Open a follow-up for the push and sandbox failures seen in trevato/quorum, and add the retry count to the run summary so a person can see a run was retried.
A crew run that loses its connection to the API (e.g.
EAI_AGAIN) now retries up to three times, waiting 5, 20 and 60 seconds, instead of ending as "no changes pushed". I couldn't check this against the real failing runs. It is tested only with a stand-in Claude Code that fails once and then succeeds. The type check and the three crew suites I ran (new, pause, limits) pass; I didn't run the fullbun test.What changed
src/crew/runner.ts, right after the first agent invocation and before the run is judged.- It resumes the same session with "Continue where you stopped." and starts fresh if there was no session. - It stops on cancel or when the run's deadline passes. - Cost and turns add up across attempts.
src/crew/network.tsis the new module that recognises a network failure and does the wait. It matchesEAI_AGAIN,ECONNRESET,ECONNREFUSED,ENOTFOUND,ETIMEDOUT,EPIPE, "fetch failed" and "can't reach the API server".test/crew-network.test.tshas a unit test for the matcher. It also has an end-to-end test where the stand-in fails once withEAI_AGAIN, retries, and the run opens its pull. I added aNET-FLAKEtrigger totest/helpers/crew-standin.tsand an optionalnetworkRetryScaleoption so tests don't wait.What I left out
landWork. I found no evidence in the issue that those were the cause, but the five run logs weren't readable from here.I didn't write a README entry or add a dependency.
Closes #1613