Skip to content

Upgrade Atomic to 0.9.38-alpha.9 and keep Planner workflow runs in Chopin's state directory - #668

Merged
lavaman131 merged 1 commit into
mainfrom
atomic-0.9.38-alpha.9
Oct 18, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
atomic-0.9.38-alpha.9

Conversation

@lavaman131

Copy link
Copy Markdown
Collaborator

Upgrades @bastani/atomic (the catalog:harness entry used by apps/server) from 0.9.37 to 0.9.38-alpha.9, the npm next tag, and adapts the atomic harness to its new workflow storage.

What changed in Atomic that matters here

0.9.38-alpha.4 to alpha.7 remove DBOS and embedded PostgreSQL. Workflow runs now persist in a local SQLite journal, by default ~/.atomic/workflows/journal.sqlite. Sessions also default to SQLite, but the harness supplies SessionManager.inMemory(), which still takes precedence. Workflow stage sessions use the Planner session's store, so they stay in memory too. The other breaking changes do not touch Chopin's code: the @bastani/workflows alias, sessionDir, session header fields, @bastani/atomic/client, and awaited SessionManager and extension writes. session.workflows.pause, listRuns, and resume keep the same shape.

Atomic's workflow tool reads the journal location only from ATOMIC_WORKFLOW_JOURNAL_PATH or the on-disk settings.json. It does not read the in-memory settings Chopin passes to the session, and createAgentSession has no journal option.

Harness

  • AtomicSettings.journal names the SQLite file. While the adapter is open, it sets ATOMIC_WORKFLOW_JOURNAL_PATH to that file and restores the previous value on shutdown(). Before a full Planner session starts, it creates the journal's directory with mode 0700. Worker sessions are unchanged because their workflows are off.
  • The production harness passes $XDG_STATE_HOME/chopin/atomic/workflows.sqlite. That puts the journal next to the per-document Planner directories, because a run resumes only with the journal and working directory it started in. An operator's non-empty ATOMIC_WORKFLOW_JOURNAL_PATH still takes precedence.

Container

  • No DBOS or Postgres env or setup existed for Atomic in the Dockerfile or the Compose files, so there was nothing to remove. The image no longer contains embedded-postgres, @dbos-inc/* or pg.
  • The image sets XDG_STATE_HOME=/var/lib/chopin, a directory owned by bun with mode 0700. Operators can mount one volume there to keep Planner directories and workflow runs when the container is replaced, instead of losing them in /home/bun. compose.yaml does not enable HARNESS=atomic, so it gets no volume.

Docs

hosted-agent.md and self-hosting.md now describe where the journal lives and how to override it, update the Atomic version, and drop the embedded PostgreSQL note.

Verification

  • GIT_CONFIG_GLOBAL=/dev/null bun test: 6194 pass, 21 skip, 0 fail. This includes the atomic adapter, atomic.contract.test.ts and atomic/full.test.ts. A full-test case now asserts that a launched workflow is journaled in the file Chopin chose and not in Atomic's default; it failed before the fix. A harness test covers the state-directory default, the operator override and the restore on shutdown.
  • bun run types and bun run ci pass.
  • docker build passes. Inside the image, @bastani/atomic and @bastani/atomic/workflows import, and a run journal opens at /var/lib/chopin/chopin/atomic/workflows.sqlite under Bun's node:sqlite. A container with HARNESS=atomic and AGENT=on started healthy against a separate PostgreSQL used only for Chopin's own storage. A named volume at /var/lib/chopin is writable by bun.
  • A targeted bun run e2e (machines, setup-agents, planner-attachment, connection): 24 passed.

The connector (apps/connector) is unchanged and does not depend on Atomic.

…opin's state directory

Atomic 0.9.38 drops DBOS and embedded PostgreSQL and journals workflow runs in
a local SQLite file, by default under the user's home. The atomic harness now
points that journal at $XDG_STATE_HOME/chopin/atomic/workflows.sqlite, beside
the per-document Planner directories a run must resume in, unless the operator
sets ATOMIC_WORKFLOW_JOURNAL_PATH. The adapter sets the variable while it is
open, restores it on shutdown, and creates the journal's directory private.

The Docker image sets XDG_STATE_HOME to /var/lib/chopin, owned by the server
user, so an operator can mount one volume to keep runs and Planner directories.
No Postgres or DBOS setup existed for Atomic in the image or Compose files, and
none is needed now.

Assistant-model: Claude Opus 5.5 (fast)
Assistant-workflow: inline (fast subagents)
Assistant-verification: bun test (6194 pass, 0 fail), bun run types, bun run ci
Assistant-verification: docker build of the server image; container started healthy with HARNESS=atomic
Assistant-verification: targeted bun run e2e (24 passed)
Co-authored-by: Alex Lavaee <alexlavaee@microsoft.com>
@lavaman131 lavaman131 self-assigned this Oct 18, 2026
@lavaman131
lavaman131 merged commit d9aec4b into main Oct 18, 2026
24 checks passed
@lavaman131
lavaman131 deleted the atomic-0.9.38-alpha.9 branch October 18, 2026 01:55
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