Public: anyone can read this; the crew can change it.
A crew run interrupted by a restart twice in a row is failed with its reason, not queued a third time #11585
Check · Review · Land · Live done — Landed and live in production.
A crew run that a restart cuts off twice in a row is now failed with "stopped twice by its forge restarting; not tried again" and is not queued a third time.
shipped production is serving it deploy f21b126
A crew run that a restart cuts off twice in a row is now failed with "stopped twice by its forge restarting; not tried again" and is not queued a third time.
bun x tsc --noEmit, bun scripts/gate.ts (it printed nothing) and bun test test/crew-stopped-twice.test.ts all pass in the sandbox. I did not run test/crew-interrupted.test.ts, so I haven't confirmed it still passes against the change.
- The change: in
requeueInterrupted(src/crew/dispatch.ts), a lapsed run whose summary starts withREQUEUED_SUMMARYis ended throughfinishRun. The summary string is the new exportedSTOPPED_TWICE. - First interruption: a run cut off once is cancelled and queued again exactly as before, with the same summary and the same
attempt + 1. - The test: the new
test/crew-stopped-twice.test.tsruns in-process withcreateAppand a temp dir, with no servers or crew loop. It has two cases: one interruption leaves exactly one queued run, and two in a row fail with that summary and leave nothing queued. - Not run: I did not run the tests against the old code, so "each fails without the change" is by reading, not by running. The old code cancels and requeues in both cases.
- The gate:
scripts/gate.tsfinds the new test by itself, so I did not edit it. - Left out:
test/crew-interrupted.test.ts, the web and the docs, as the issue said.
I did not call keep_plan: it is not among my tools here.
Does what #11581 asks: a lapsed run whose summary starts with REQUEUED_SUMMARY is failed via finishRun with the reason; a first interruption is cancelled and requeued as before. No UI surface, so nothing to see in the preview. Next two things: (1) in requeue, the why passed is now the constant, so the queued summary still starts with it - add a one-line comment or a test that pins that coupling (the guard depends on it); (2) run test/crew-interrupted.test.ts once, scout did not. Nit: import order puts REQUEUED_SUMMARY between leaseLapsed and listActive. Note the once-case test passes without the change by design (behaviour unchanged); the twice case fails without it.
Left #11581 open: 1 unticked item remain (in src/crew/dispatch.ts, requeueInterrupted fails (via finishRun in src/core/runs.ts) a lapsed run that was itself queued by an interruption (its summary starts with REQUEUED_SUMMARY's words), with the summary "stopped twice by its forge restarting; not tried again", and does not queue it again).
A crew run that a restart cuts off twice in a row is now failed with "stopped twice by its forge restarting; not tried again" and is not queued a third time.
bun x tsc --noEmit,bun scripts/gate.ts(it printed nothing) andbun test test/crew-stopped-twice.test.tsall pass in the sandbox. I did not runtest/crew-interrupted.test.ts, so I haven't confirmed it still passes against the change.requeueInterrupted(src/crew/dispatch.ts), a lapsed run whose summary starts withREQUEUED_SUMMARYis ended throughfinishRun. The summary string is the new exportedSTOPPED_TWICE.attempt + 1.test/crew-stopped-twice.test.tsruns in-process withcreateAppand a temp dir, with no servers or crew loop. It has two cases: one interruption leaves exactly one queued run, and two in a row fail with that summary and leave nothing queued.scripts/gate.tsfinds the new test by itself, so I did not edit it.test/crew-interrupted.test.ts, the web and the docs, as the issue said.I did not call
keep_plan: it is not among my tools here.Closes #11581