Skip to content

Remove workflow runs from Chopin - #970

Merged
lavaman131 merged 2 commits into
mainfrom
remove-runs
Nov 20, 2026
Merged

lavaman131 merged 2 commits into
mainfrom
remove-runs

Conversation

@lavaman131

@lavaman131 lavaman131 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Chopin showed a card in Chat, and in threads, for each workflow run a remote Planner's client reported over the agent connection. Stop and Resume Planner paused and resumed those runs, and the server kept the client's session past its turn, and past a dropped link, for as long as any run was live or paused. A Planner on Atomic 0.10 or later has no workflows, and a client's own work that outlives its turn is the client's to report in its replies. So Chopin no longer tracks, shows or controls runs.

Rollout order: the remote Planner client stops sending run reports first, in a separate change to that client, and only then does this deploy. This server refuses a runs report, and an input-request that names a run, as a malformed message and closes the link with 1008. A client that still sends them is cut off and loses the sessions that link held. The server never lists run-stage-deltas in attached.features. There is no compatibility path.

What

Agent connection (packages/agent-link, docs/agent-connection.md)

  • The runs message, the run-stage-deltas feature, the server's stop and resume run controls, and workflowRunId, workflowStageId and rootRunId on input-request are gone from the schema, the package client (reportRuns, splitRuns, the control handler) and the docs. The docs say what an earlier version had and that this server refuses it.
  • control-result now only answers steer.
  • A question asked while a turn runs belongs to that turn: stopping the turn withdraws it. Before, a question that named a run outlived a Stop.

Server (apps/server)

  • The server no longer tracks runs: watchRuns, publishRuns, run stages and their paging route (/api/channels/<id>/runs/<run id>/stages), the held and unanswered Stops of a dropped link, and the wait that held an answer while its run was paused are all removed.
  • A Planner session outlives its turn only while it waits on a question it asked or on an answer its client has not acknowledged. A resumable link that drops unexpectedly keeps exactly those sessions; with none, its ownership runs the ordinary grace period.
  • Stop Planner (chat:abort) stops the running turn. With no turn running, it lets go a kept session that waits on a question, which withdraws the question. chat:resume, chat:pause-run and chat:resume-run are gone.
  • A command of kind workflow is no longer special: it runs as /name args, as every other kind does.
  • planner_link_holds rows are written with stops: []. When a hold is rebuilt after a restart, a session that an earlier release kept only for a run (no question waiting, no answer owed) is not rebuilt, and its AI launch ends. Without this, a deploy could rebuild such a session and leave its document busy with no deadline.
  • A document saved by an earlier release with run cards in its Chat opens without them, and is saved without them.

Web (apps/web)

  • Chat and threads draw no run cards. The composer has no Resume button, and a command of kind workflow gets no group name or icon of its own. The card under the transcript now shows only a running build. The design audit's "Workflow runs" plate is now "Running build". The Stop and Resume run icons are deleted.

Storage

  • Migrations stay expand-only, so workflow_run_stages is kept but no longer read or written. The previous release still writes run stages until its cut, and on a rollback it refuses migration ids it does not know, so this change adds no migration. A later release can drop the table once no process of this release's predecessor can run. planner_link_holds.stops stays, and is always written empty.

Docs

docs/agent-connection.md, docs/hosted-agent.md, docs/storage.md, docs/chopin-cli.md, docs/local-agent-mcp.md, docs/architecture.md, docs/decisions.md, docs/machine-runner-design.md, AGENTS.md and apps/web/DESIGN.md no longer describe run cards, run reports, run control or keeping a session for a run.

Overlay scrollbar (its own commit, 4eaf9cc)

Taking the run card out of threads exposed an older bug in Chat's overlay scrollbar. The thumb's place was an offset in pixels, computed in each scroll event from the scroll timeline's progress times the range known at that moment. If the range then changed with no further scroll, the thumb stayed where it was. A thread opened at its newest line hits this: it is scrolled to its end while its rows are still mounting, and nothing scrolls it again. In a 640 by 800 window, a 60-reply thread was at its end (scrollTop 3178 of 3178) while its thumb sat 221 px down its 520 px travel. The old chat-run-scrollbars spec only passed because unfolding the thread's run card scrolled the thread again. The thumb now reads the timeline's progress when it is drawn, which, like the old read in the scroll event, forces no layout.

Tests

  • Removed: the tests for run cards, run reports, run stage storage and paging, the run strip, run control and held Stops.
  • Changed: tests that used a run to give a session work now use an open question. These are in planner-dispatch.test.ts, link-resume.test.ts, reaction-reader.test.ts, handover-window.test.ts and remote-planner.test.ts.
  • New:
    • link.test.ts: a run report, and a question that names a run, close the link as malformed, and run-stage-deltas is never echoed.
    • protocol.test.ts and client.test.ts: the schema has no run messages, and the client asks for no run feature.
    • link-resume.test.ts: once a link's question is answered and the answer acknowledged, a drop keeps nothing and the ownership runs the grace period.
    • handover-window.test.ts: a hold row from an earlier release with a session it kept only for a run is not rebuilt, and that session's AI launch ends. Beside it, only the session whose question its client waits on is given back. Both of these tests failed before the fix to PlannerAttachments.restore.
    • plan/persistence.test.ts: a document saved with run cards opens and saves without them.
    • address.test.ts, commands.test.ts and chat-agent-commands.e2e.ts: a workflow command runs as /name args.
    • chat-scrollbars.e2e.ts (renamed from chat-run-scrollbars.e2e.ts): a thread opened at its newest line, with no scroll after it, has its thumb at the end of its lane. Before the scrollbar fix this failed with the thumb 305 px short of the lane's end, while the view was at its end.

Verification

Run on this branch, rebased on 73d6370:

  • bun run fix made one formatting change, which is in the commit. bun run ci and bun run types pass.
  • GIT_CONFIG_GLOBAL=/dev/null bun test apps packages at this head ran 9345 tests. Everything passed except 4 connector sandbox tests in apps/connector/src/main.test.ts and sandbox.test.ts, plus one late assertion from one of them, reported as an error between tests. All 4 time out on this VM, and they fail the same way on main.
  • bun test apps/server/src/storage/postgres apps/server/src/machine-store, against my own PostgreSQL: 256 of 257 passed. startup.test.ts timed out once under load, then passed 5 of 5 when run alone.
  • Browser tests, run under flock with my own ports and databases:
    • chat-agent-commands, chat-scrollbars, connection-banner, handover, implementation-launcher, planner-attachment, composer-send-stop, chat-hover-contrast and steering: 92 passed. The only 3 failures were the thread-thumb checks in chat-scrollbars, which led to the scrollbar fix.
    • With the fix, chat-scrollbars, chat-long-transcript and chat-threads: 14 passed. That includes chat-long-transcript's check that scrolling under the pointer forces no layout.
    • At this head (298d633), chat-scrollbars (with the new thread-thumb test) and chat-agent-commands: 15 passed.

CI on 298d633 passes every check. The integration suite reported 4 flaky tests that passed on retry. One of them is this change's chat-scrollbars.e2e.ts:315, "in a phone the transcript's thumb is whole". On its first try, main Chat's lane fell outside the viewport (inView false); the thumb's position was right (fromEnd 0). The same phone test, as chat-run-scrollbars.e2e.ts, was flaky on main in CI runs 44815063317 and 44793078719.

Chat's overlay scrollbar kept where its thumb was as an offset in pixels, taken in each scroll
event from the scroll timeline's progress times the range it knew then. When the transcript's
range changed with no scroll after it, the thumb stayed where that old offset put it. A thread
opened at its newest line does this: it is scrolled to its end while its rows are still mounting,
and nothing scrolls it again. In a 640 by 800 window, a thread with 60 replies sat at its end
(`scrollTop` 3178 of 3178) while its thumb was drawn 221 px down its 520 px travel, until the reader
scrolled. A run card in the thread used to hide this, because unfolding the card scrolled the
thread again.

The thumb now takes its place from the timeline's progress when it is drawn, in the frame after the
scroll or resize that asked for it. Reading the timeline there costs no layout, as reading it in the
scroll event did.

A new browser test opens a long thread at its newest line, points at it without scrolling, and
expects the thumb at the end of its lane. It fails before this change, with the thumb 305 px short,
and passes with it. `chat-long-transcript.e2e.ts` still finds no forced layout while scrolling under
the pointer.
Chopin showed run cards for the workflow runs a remote Planner's client
reported, let Stop and Resume Planner pause and resume them, and kept the
client's session past its turn, and past a dropped link, while any run was
live or paused. None of that is Chopin's to keep any more: a client's own
work that outlives its turn is the client's to report in its replies.

Chat and threads draw no run cards, and the composer has no Resume button;
the build card under the transcript stays. The agent connection loses the
`runs` report, the `run-stage-deltas` feature, the `stop` and `resume`
run controls, and `workflowRunId`, `workflowStageId` and `rootRunId` on
`input-request`: a client that still sends them is refused as a malformed
message, and `run-stage-deltas` is no longer echoed in `attached.features`.
A command of kind `workflow` runs as the same `/name args` any other kind
does. The server tracks no runs, holds no Stops for a client's return, and
no longer pages run stages.

A session still outlives its turn, and a dropped resumable link is still
kept, while it waits on a question it asked or on an answer its client has
not acknowledged. Stop Planner stops the running turn, or with none running
withdraws the question a kept session waits on.

`workflow_run_stages` and the `stops` field of `planner_link_holds` stay, so
the previous release can still run beside this one: the table is no longer
written or read, and every hold this release writes has no Stops. A hold an
earlier release wrote for a session it kept only for a run is not rebuilt,
and that session's AI launch ends.
@lavaman131
lavaman131 merged commit 3d15d19 into main Nov 20, 2026
25 checks passed
@lavaman131
lavaman131 deleted the remove-runs branch November 20, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant