githubnext/chopinPublic

Let's compose rich plans together

Keep workflow runs across reloads and show concurrent runs as one stack

Run cards lived only in server memory, so a reload after the last run
ended, or any restart, dropped them. Store them in the document's
sidecar: ended runs stay until the next workflow starts in the document,
and a run that was live when the room went away comes back stopped.

Several runs can be live at once, so Chat now shows one stack of run rows
instead of a card per run. Runs waiting on Decisions come first, then
running, paused, and ended runs, newest first within each; more than three
rows fold behind "more" without hiding a waiting run. Only the first
waiting run, or else the newest live one, shows its stages, and any row
opens on click. Each live or paused row has its own pause or resume
control (chat:pause-run, chat:resume-run) through session.workflows,
recorded in the transcript. Stored stages are capped at the twelve most
recent, with earlier ones counted. A drawn ring replaces the text glyph for
pending and paused work.

Assistant-model: Claude Opus 5.5
Assistant-workflow: inline
Assistant-verification: bun test passed: 1764 pass, 2 PostgreSQL skips, 0 fail, including sidecar round trip, run merging, per-run control, stage cap, and stack ordering and folding
Assistant-verification: bun run types passed: all workspaces
Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings)
User-preference: A finished workflow's card stays until the next workflow run starts, including across reloads
User-preference: Concurrent workflow runs show as one stack ordered by who needs attention, with per-run pause and resume beside Stop all
Co-authored-by: Alex Lavaee <lavaman131@github.com>
ALAlex Lavaee authored
609ab39Patch
Parentdb1e757
16 files changed+708-136
StackedSplit
apps/server/src/chat/invoke.test.ts+46 −0
apps/server/src/chat/service.ts+64 −6
apps/server/src/harness/atomic/full.test.ts+53 −0
apps/server/src/harness/atomic/full.ts+20 −7
apps/server/src/harness/session.ts+10 −0
apps/server/src/main.ts+5 −0
apps/server/src/plan/persistence.test.ts+46 −0
apps/server/src/plan/service.ts+58 −1
apps/web/src/chat/chat.tsx+10 −3
apps/web/src/chat/run-card.css+47 −0
apps/web/src/chat/run-card.test.tsx+89 −0
apps/web/src/chat/run-card.tsx+190 −68
apps/web/src/design-audit/inventory.ts+1 −1
apps/web/src/design-audit/surfaces.tsx+45 −45
docs/hosted-agent.md+13 −5
packages/protocol/chat.d.ts+11 −0