Repository navigation
Upgrade Atomic to 0.9.38-alpha.9 and keep Planner workflow runs in Chopin's state directory - #668
Merged
Merged
Conversation
…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>
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.
Upgrades
@bastani/atomic(thecatalog:harnessentry used byapps/server) from 0.9.37 to 0.9.38-alpha.9, the npmnexttag, 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 suppliesSessionManager.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/workflowsalias,sessionDir, session header fields,@bastani/atomic/client, and awaitedSessionManagerand extension writes.session.workflows.pause,listRuns, andresumekeep the same shape.Atomic's workflow tool reads the journal location only from
ATOMIC_WORKFLOW_JOURNAL_PATHor the on-disksettings.json. It does not read the in-memory settings Chopin passes to the session, andcreateAgentSessionhas no journal option.Harness
AtomicSettings.journalnames the SQLite file. While the adapter is open, it setsATOMIC_WORKFLOW_JOURNAL_PATHto that file and restores the previous value onshutdown(). Before a full Planner session starts, it creates the journal's directory with mode0700. Worker sessions are unchanged because their workflows are off.$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-emptyATOMIC_WORKFLOW_JOURNAL_PATHstill takes precedence.Container
Dockerfileor the Compose files, so there was nothing to remove. The image no longer containsembedded-postgres,@dbos-inc/*orpg.XDG_STATE_HOME=/var/lib/chopin, a directory owned bybunwith mode0700. 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.yamldoes not enableHARNESS=atomic, so it gets no volume.Docs
hosted-agent.mdandself-hosting.mdnow 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.tsandatomic/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 typesandbun run cipass.docker buildpasses. Inside the image,@bastani/atomicand@bastani/atomic/workflowsimport, and a run journal opens at/var/lib/chopin/chopin/atomic/workflows.sqliteunder Bun'snode:sqlite. A container withHARNESS=atomicandAGENT=onstarted healthy against a separate PostgreSQL used only for Chopin's own storage. A named volume at/var/lib/chopinis writable bybun.bun run e2e(machines, setup-agents, planner-attachment, connection): 24 passed.The connector (
apps/connector) is unchanged and does not depend on Atomic.