Keep the Planner while its workflows run, with Stop/Resume and a run card - #230
Open
lavaman131 wants to merge 13 commits into
Open
lavaman131 wants to merge 13 commits into
lavaman131 wants to merge 13 commits into
Conversation
lavaman131
added this pull request to stack #220
September 30, 2026 17:13
lavaman131
force-pushed
the
atomic-planner-run-control
branch
from
October 1, 2026 15:27
d18de6e to
0931da6
Compare
lavaman131
force-pushed
the
atomic-planner-run-control
branch
2 times, most recently
from
October 1, 2026 15:42
0931da6 to
1b76647
Compare
Chopin destroyed every Planner session when its turn ended. A workflow the atomic Planner starts runs in the background under that session, so it was orphaned seconds after launch and never progressed. Keep an atomic Planner session, its owner binding, and the loaded document while the session still owns live or paused workflow runs, tracked through Atomic's workflow activity stream; the next turn reuses it so the Planner can still steer its runs. The session is let go when the runs finish, the owner binding ends, or the document closes. Stop Planner now also pauses the session's live runs, resumably, and a new Resume Planner control (`chat:resume`) resumes them. Chat state carries the running and paused counts, and the composer shows them. Run control goes through the session's own workflow commands until the SDK exposes run-control primitives. The document's working directory without a checkout moves from the shared temporary directory to a per-channel directory under Chopin's per-user state directory, so workflow files survive restarts. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1751 pass, 2 PostgreSQL skips, 0 fail, including new retention, pause, resume, release, and run-classification tests Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: source check passed: DBOS records showed a Planner-launched run with no progress after its turn ended, matching the per-turn session disposal User-preference: A pause in the Planner pauses its workflows and resume resumes everything; steering goes to the main chat, which decides whether to steer a workflow over intercom User-preference: Keep long-lived Planner working directories out of the shared tmp Co-authored-by: Alex Lavaee <lavaman131@github.com>
Document titles are unique per repository, so creating a second document with an existing title failed in storage and came back as idempotency-conflict, which reads as a reused key. Report it as title-taken instead. create_document's output schema also described only success, so strict MCP clients rejected its idempotency-conflict, document-unavailable, and validation-issue responses as schema violations and callers never saw the real outcome; declare them the way update_document does. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1752 pass, 2 PostgreSQL skips, 0 fail, including a new hosted test for title-taken Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: raw JSON-RPC probe passed: a fresh key with an existing title returned idempotency-conflict before this change, and a new title succeeded Co-authored-by: Alex Lavaee <lavaman131@github.com>
… prompt Replace the running/paused count with a card per run, built from Atomic's workflow lifecycle hooks: the run's name and status (running, waiting on Decisions, paused, or ended), elapsed time, each stage it reached with its status and duration, and a link to the Decisions it waits on. Chat records a line when a run ends. Stop now passes --yes to the pause command: without it, Atomic asked the host to confirm, which Chopin routes to Decisions, so the pause waited on a question instead of pausing. A design-audit specimen covers the running, waiting, paused, and finished states. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1753 pass, 2 PostgreSQL skips, 0 fail, including run-card folding, paused/waiting/finished status, and the run-ended transcript line Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: Stop Planner on a run waiting in Decisions left "1 workflow running" because the pause waited on its own confirmation User-preference: Show the workflow's current stages in Chopin, and have pause or quit change what Chat shows immediately Co-authored-by: Alex Lavaee <lavaman131@github.com>
…se live runs Stop Planner reported that it paused the workflows, but they kept running: the /workflow slash command reports its outcome only through ui.notify, which a headless session drops, so a refused or no-op pause looked like success. Run pause and resume through the session's own workflow tool with a real tool context instead, so the outcome returns as a result and a failure reaches the chat transcript. The run card's spinner never animated because chat-tool-loader has no animation in the web app. Live runs and running stages now show a pulsing dot that stays still under reduced motion. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1754 pass, 2 PostgreSQL skips, 0 fail, including run control through the workflow tool and its failure path Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: Stop Planner posted "paused its workflows" while the run card stayed running and no pause was recorded User-preference: Live workflow runs in Chopin show a pulsing dot rather than a spinner Co-authored-by: Alex Lavaee <lavaman131@github.com>
Atomic pauses running and pending stages only, so Stop Planner on a run whose live stage was waiting on a question changed nothing, while the transcript said it paused. Read the workflow tool's reported status, and when a pause changes nothing, quit each live run instead: quitting keeps the run resumable, withdraws its open question from Decisions, and asks it again on resume. A run that neither pause nor quit can stop reports the failure in Chat. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1755 pass, 2 PostgreSQL skips, 0 fail, including pause, quit fallback, and unstoppable-run failure Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: Stop Planner on a run waiting in Decisions left the run card running User-preference: A pause in the Planner pauses its workflows and resume resumes everything Co-authored-by: Alex Lavaee <lavaman131@github.com>
…ocked A run card vanished the moment its last run ended, because Chat kept cards only while a run was live or paused. Keep ended cards as a one-line summary with the stage list behind a toggle. A run Atomic ends as blocked, for example at its review limit, showed as failed; it now shows as blocked, and the transcript line says it ended blocked. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1755 pass, 2 PostgreSQL skips, 0 fail Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: a run blocked at its review limit disappeared from Chat and its transcript line said "failed after 31 min" Co-authored-by: Alex Lavaee <lavaman131@github.com>
Atomic's SDK now exposes session.workflows (bastani-inc/atomic#3377). Stop and Resume now call session.workflows.pause({ all: true }) and resume each paused run, and a partial pause reports the runs still active, replacing the workflow tool called with a hand-built tool context and the quit fallback. Atomic now counts a run whose stage waits on a question as paused and leaves the question open, so Stop no longer withdraws it from Decisions. An answer given while the run is paused is recorded but returned to the run only after Resume, so the paused run never advances. A run with a stage waiting on a question now shows as waiting on Decisions even when no prompt lifecycle event arrives. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1757 pass, 2 PostgreSQL skips, 0 fail, including run control, held answers for paused and child runs, and the waiting count 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: Use Atomic's SDK run-control primitives instead of slash commands or tool workarounds Co-authored-by: Alex Lavaee <lavaman131@github.com>
Chopin counted a workflow root as live only while Atomic reported it working or blocked. Atomic also reports a live run as idle and quiescent whenever nothing is counted as executing, for example between steps, so Chopin released the Planner session mid-run, dropped its card, and left the run orphaned. A root is now paused when Atomic says so, ended only once its run's lifecycle reports an end or the root disappears, and live otherwise. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1757 pass, 2 PostgreSQL skips, 0 fail, including a quiescent root of a live run counted as live Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: on Atomic 0.9.25-alpha.5 the run card vanished eight minutes into grill-me-1 and the run made no further progress Co-authored-by: Alex Lavaee <lavaman131@github.com>
Atomic withdraws a paused run's open question from Decisions and presents it again on Resume, so say that instead of describing the question as staying open. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: agent-browser E2E passed: on Atomic 0.9.25-alpha.5, Stop paused a run waiting on its intent review, Resume presented the same question in Decisions again, and answering it let the run continue to review Co-authored-by: Alex Lavaee <lavaman131@github.com>
Atomic's workflow guidance tells the model to point people at /workflow connect, so the Planner told Chopin members to run a command they have no way to type. The atomic Planner's instructions now say that members use Chopin in a browser, that slash, terminal, and Atomic CLI commands are unavailable to them, and that a started workflow is followed through its run card in Chat, Decisions, and Stop or Resume Planner, with the Planner offering to check on or steer the run itself. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: session and agent tests (67 pass), including the instruction text for checkout and scratch workspaces and its absence for isolated harnesses 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: Chopin members can't run slash commands; the Planner should point them to Chopin's own UI instead of /workflow connect Co-authored-by: Alex Lavaee <lavaman131@github.com>
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>
A workflow built from ctx.tool steps showed no steps in its run row, because only stage lifecycle events were folded. Tool steps now appear in order beside stages, marked with a new Nucleo-style wrench icon and "tool step" for screen readers; cached counts as done and cancelled as skipped. Per-run pause and resume ignored Atomic's outcome, so a pause Atomic could not apply, such as during a running ctx.tool call, was reported as done. A noop or cancelled outcome is now a failure with Atomic's message. Runs of the same workflow are told apart by a short run id in their rows and control labels. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun test passed: 1767 pass, 2 PostgreSQL skips, 0 fail, including tool steps, the wrench and screen-reader label, and duplicate-name labels Assistant-verification: bun run types passed: all workspaces Assistant-verification: bun run ci passed: dprint, oxlint, tokens, type scale, Impeccable (no new findings) Assistant-verification: agent-browser E2E failed before this change: two concurrent ctx.tool-only runs showed no steps, and pausing one reported "paused" while it kept running User-preference: Tool stages show a tool icon Co-authored-by: Alex Lavaee <lavaman131@github.com>
The stack spread a controls object into each row, which the contract reads as an unreviewed dynamic style; pass the three callbacks explicitly. The pulse and ring now use the radius and motion tokens instead of a literal radius, duration, and easing curve. Resume Planner's icon is the same standalone artwork as Stop Planner's, so it carries the same reviewed palette exception. WrenchIcon forwards props through LineIcon like every other line icon, so it joins that reviewed case, and the line icons and icon catalogue review hashes are renewed for the new icon and catalogue entries, whose data flows are unchanged. Assistant-model: Claude Opus 5.5 Assistant-workflow: inline Assistant-verification: bun run ci passed: dprint, oxlint, tokens, design contract, design record, Impeccable (no new findings); before this change the contract reported the run-card spread, literal radius and motion, the resume icon palette, and the changed icon owners Assistant-verification: bun test passed: 1902 pass, 2 PostgreSQL skips, 0 fail Assistant-verification: bun run types passed: all workspaces Co-authored-by: Alex Lavaee <lavaman131@github.com>
lavaman131
force-pushed
the
atomic-planner-run-control
branch
from
October 1, 2026 16:18
1b76647 to
24659d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #215. Partly implements #221.
An atomic Planner session that starts an Atomic workflow now outlives its turn. Until now, Chopin destroyed the session when the turn ended, which left the run orphaned seconds after launch.
What changes
workflowtool, which returns a structured result instead of a dropped UI notice. Atomic can't pause a run whose only live stage is waiting on a question, so that run is quit instead. It stays resumable and its open question is withdrawn from Decisions. The newchat:resumemessage and the Resume Planner button resume paused runs.create_documentoutcomes. It now reportstitle-taken, and declares itsidempotency-conflict,document-unavailableand validation-issue outcomes in its output schema. Before, strict MCP clients rejected those responses as schema violations.Verification
bun test: 1755 pass, 2 PostgreSQL skips, 0 fail.bun run typesandbun run cipass, with no new Impeccable findings.Known gaps
HostInput.Assistant-workflow: inline
Assistant-verification: bun test passed: 1755 pass, 2 skip, 0 fail
Assistant-verification: bun run types and bun run ci passed
Assistant-verification: agent-browser E2E passed: run card, Stop/Resume, Decisions answered, workflow wrote its spec and plan
Co-authored-by: Alex Lavaee lavaman131@github.com