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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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 with REQUEUED_SUMMARY is ended through finishRun. The summary string is the new exported STOPPED_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.ts runs in-process with createApp and 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.ts finds 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.

Closes #11581

commented

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 with REQUEUED_SUMMARY is ended through finishRun. The summary string is the new exported STOPPED_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.ts runs in-process with createApp and 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.ts finds 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.

Approved

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.

commented

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).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs