Public: anyone can read this; the crew can change it.

A deploy the forge's own restart interrupted reads as Failed, beside a real failure #271

Closed opened this
Closed without merging

Pushed. I'm out of budget to run the full bun run check suite (it's a long, multi-file run), but the directly relevant tests (apps.test.ts, studio-words.test.ts, studio.test.ts) all pass, and tsc --noEmit is clean.

Notes

stopped closed without shipping deploy a2f65f0

opened this

Pushed. I'm out of budget to run the full bun run check suite (it's a long, multi-file run), but the directly relevant tests (apps.test.ts, studio-words.test.ts, studio.test.ts) all pass, and tsc --noEmit is clean.

Summary

A deploy the runtime aborts because it is stopping now ends cancelled with the summary "the forge stopped" — the same one the already-queued case used — instead of failed. The distinction is structural (this.stopped && abort.signal.aborted at the point the step fails in execute()), never derived from parsing free-text output, so a real install/test failure that happens to coincide with a stop still fails correctly (unchanged path).

Changed:

  • src/apps/runtime.ts: new STOPPED_SUMMARY constant; execute() routes an abort caused by the runtime stopping to cancelRun instead of finishRun("failed"); describe() no longer treats a cancelled attempt as the environment's own error (stale lastError is left alone), and reads state.queued as "deploying"/"starting" when a redeploy is already lined up.
  • src/web/studio/words.ts: runWord gives every cancelled run its own quiet word, "cancelled" (secondary/grey badge, ban icon) — never the same "stopped" word a real failure gets. Its note is "interrupted by a restart" for the forge-stopped case, and the plain summary (e.g. "superseded by <oid>") otherwise, unchanged from today.
  • src/web/studio/lists.ts: cancelled folds into the stopped list filter, same as failed does.
  • src/web/client.ts: the run page's live-repaint script mirrors the same word so it never drifts from the server-rendered badge.
  • src/apps/process.ts needed no change — the abort signal already distinguishes a genuine non-zero exit from a killed step.

Test added (test/apps.test.ts): starts a deploy whose install blocks on sleep 30, waits for it to actually be running, calls runtime.stop() mid-flight, and asserts the run ends cancelled with STOPPED_SUMMARY, that runWord reports { word: "cancelled", note: "interrupted by a restart" }, that the run's own studio page renders data-word="cancelled" (never "stopped"), and that the environment's status carries no error afterward.

What I left out: checkRunWord (a pull's own check state) is untouched, per the issue — a superseded deploy's check still reads exactly as before. I did not add a test asserting the app page's "Now" row specifically, since that section only ever lists agent-kind runs, not deploys — I verified the badge instead on the run's own page (/runs/:id), which is what actually renders a deploy run's word.

Worth a look: the execute() diff in runtime.ts (the core fix), the new describe() branch for a queued-but-not-yet-claimed deploy, and the new runWord cancelled branch in words.ts.

Budget reached at $4.26; this is where it stopped.

Closes #255

commented

Parked by the crew: the check failed and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs