githubnext/chopinPublic

Let's compose rich plans together

Keep the Planner while its workflows run, and let Stop pause them

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>
ALAlex Lavaee authored
bca2de7Patch
Parentaeb8dd0
19 files changed+626-88
StackedSplit
apps/server/src/agent/planner.ts+2 โˆ’2
apps/server/src/chat/invoke.test.ts+179 โˆ’3
apps/server/src/chat/service.ts+147 โˆ’17
apps/server/src/harness/atomic/adapter.ts+10 โˆ’2
apps/server/src/harness/atomic/full.test.ts+21 โˆ’1
apps/server/src/harness/atomic/full.ts+58 โˆ’2
apps/server/src/harness/atomic/workspace.ts+32 โˆ’26
apps/server/src/harness/harnesses.ts+2 โˆ’2
apps/server/src/harness/session.test.ts+31 โˆ’10
apps/server/src/harness/session.ts+35 โˆ’3
apps/server/src/main.ts+11 โˆ’0
apps/web/src/assets/icons/planner-resume.svg+7 โˆ’0
apps/web/src/chat/chat.tsx+39 โˆ’6
apps/web/src/design-audit/icons.tsx+2 โˆ’0
apps/web/src/tokens.test.ts+6 โˆ’0
docs/hosted-agent.md+21 โˆ’5
docs/local-agent-mcp.md+2 โˆ’2
docs/self-hosting.md+7 โˆ’5
packages/protocol/chat.d.ts+14 โˆ’2