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

An app that is live says nothing: production's own output reaches the page only while it is deploying #321

Merged opened this

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

Merged

Pushed successfully.

shipped production is serving it deploy 7b21267

opened this

Pushed successfully.

Production's own output now reaches the app page for as long as it runs, not just during the deploy. productionTail in src/web/studio/previews.ts tails a running production the same way it already tailed a deploying one — named "the app" instead of "the deploy", with a quiet line ("Production is quiet — it hasn't said anything yet.") instead of an empty box when nothing's been written yet. A viewer who can't see the owner's facts sees no output at all, since an app's stdout can carry anything. The one-stream rule holds: a running agent run still wins the page's single stream over production's tail.

The run-log follow stream (src/http/api.ts) previously closed the moment its run hit a terminal state, but a deploy run's log keeps growing for as long as the app process it swapped in stays alive. The stream now checks whether the environment still points at that run as the one serving (running or deploying) before sending done; only a redeploy or an explicit stop actually retires it.

src/web/studio/app.ts now distinguishes deployTailing (used only by "Now"'s deploy-specific wording) from tailing (used to decide whether the no-script refresh keeps polling), since the page must keep refreshing for a live app's tail too, not only a deploy's.

Tests added in test/studio.test.ts cover: production running with lines renders the tail named "the app"; the same page for a stranger shows nothing; an agent run still outranks production's tail; and a fresh silent app shows the quiet sentence, no box. test/apps-api.test.ts covers the stream staying open past run.finished while still serving, and closing once the environment is stopped.

Left out: widening the log cap or opening a second concurrent stream — both explicitly out of scope per the issue.

🤖 Generated with Claude Code

Closes #284

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs