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

Stopping production in the middle of a deploy reads "Not running", not "Failed to start" #16277

Merged opened this

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

Merged

A person who stopped production while a deploy was in flight was told "Failed to start. Deploy main to try again.": stopEnv aborted the deploy and the deploy recorded the abort as a failure. Stop and remove now abort with a reason (EnvStop), and the deploy cancels its run as stopped, so production reads "Not running.

Notes

shipped production is serving it deploy 3fede26

opened this

A person who stopped production while a deploy was in flight was told "Failed to start. Deploy main to try again.": stopEnv aborted the deploy and the deploy recorded the abort as a failure. Stop and remove now abort with a reason (EnvStop), and the deploy cancels its run as stopped, so production reads "Not running. Deploy main to start it."

This is also why test/web-apps.test.ts "the app page says in a sentence that production is not running, and what to do" failed on the full check of nearly every pull on 2026-11-24: its wait returned as soon as any earlier run had finished, so its stop often arrived while the previous test's redeploy was in flight. The test now holds the runtime's only permit, so its own redeploy is in flight when the stop arrives, and expects "Not running".

test/crew-review-stall.test.ts waits for the run.finished event in place of an 8 s clock: a signal, not a clock. The cause of that test's failures on the forge's host is not yet proven; this removes the clock whatever it is.

Proof, in a container of the forge's own image: before, the web-apps test fails every time ("Failed to start"); after, ten runs under load, 30 pass, 0 fail.

Part of #16213. Try: start a deploy of an app's production, press Stop while it runs, and read the app strip. No look: the sentence already exists; only which state leads to it changes. Direction: a fault a person meets and a test red on main that counted against pulls (#16213).

--- UNBLOCKER for every open Talk pull: #16206, #16207 and #16252 are red on this one test alone. Found and fixed by the voice builder; put on its own branch by the steward. Checked: type check clean; gate, no rule line; on Linux in the forge's own image the two test files 30 pass and all app tests 624 pass, 0 fail.

🤖 Generated with Claude Code

Changes requested — before the latest push

The fix itself is sound: aborting with an EnvStop reason and cancelling the run instead of failing it is the right shape, and the web-apps test now reproduces the mid-deploy stop deterministically. Two things to change in this round.

  1. src/apps/runtime_env.ts: the new EnvStop block was inserted between the doc comment "What a finished deploy's summary ends with" and the constants it describes. That comment now sits on nothing, and TESTS_PASSED_TAIL has lost its description. Move EnvStop above that comment, or somewhere else, and keep the original comment attached to its constants.
  2. test/crew-review-stall.test.ts: the rewrite is unrelated to this issue. It adds a second helper, ended, that duplicates agentRunSettled in helpers/crew-standin.ts, so there are now two ways to wait on a settled run. It also removes the 8s bound, so a hang now waits for the whole test timeout. Revert this file. If agentRunSettled really is flaky, fix the shared helper, or open a separate pull or issue for it. Leaving a flaky test in place is a Never.

I did not exercise the preview. This change has no page or terminal surface, and the behaviour is covered by the web-apps test.

commented

Steward note: new head 31b63c2a, answering the review.

  1. EnvStop now sits above the comment "What a finished deploy's summary ends with", so that comment is back on TESTS_PASSED_TAIL and its constants.
  2. test/crew-review-stall.test.ts is reverted to main's: that change was unrelated and removed a bound. The stalled-brief test's failures on the forge's host stay on #16213 for their own fix in the shared helper.

The pull is now four files: the three runtime files and test/web-apps.test.ts. Checked: type check clean; gate, no rule line; web-apps 29 pass.

Approved

Both earlier asks are met on 31b63c2a. EnvStop now sits above its own comment, so the TESTS_PASSED_TAIL comment is back on its constants. The unrelated crew-review-stall test change is reverted, and the pull is four files. The change reads right: stop and remove abort the deploy with an EnvStop reason, and execute cancels the run with that summary. The environment then reads stopped, not failed, and a real failure still fails. The reworked test holds the deploy at the runtime's only permit, so it reproduces the in-flight stop that it needs. I fetched the preview at this head: / answers 200 with 15 KB of server-rendered HTML, and this change touches no page markup.

Non-blocking: add one assertion that the cancelled run's summary is "stopped", so the wording is pinned. Non-blocking: say in the pull that the stalled-brief test failures stay on #16213.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs