Skip to content

Finish ACP session resume and persistence docs#1493

Closed
NathanFlurry wants to merge 4 commits into
mainfrom
codex/session-resume-architecture-docs
Closed

Finish ACP session resume and persistence docs#1493
NathanFlurry wants to merge 4 commits into
mainfrom
codex/session-resume-architecture-docs

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Jun 20, 2026

Copy link
Copy Markdown
Member

What changed

  • Adds ACP resume orchestration for persisted sessions, including native session/load / session/resume and transcript fallback via a one-shot preamble.
  • Persists outbound user prompts and captured session updates so actor SQLite can reconstruct session transcripts after sleep/wake.
  • Adds session resume regression coverage, OpenCode fallback/native resume coverage, public export coverage, and related protocol/client updates.
  • Adds website architecture docs under Reference > Advanced > Architecture > Sessions & Persistence and records architecture-doc maintenance guidance in CLAUDE.md.
  • Removes accidentally committed local secure-exec link: / Cargo path dependency state, returning the workspace to just secure-exec-status pinned mode.
  • Tightens ACP post-spawn cleanup so create/resume failures kill the adapter process before returning, and reports terminal disposal as abnormal exit instead of clean exit 0.

Why

RivetKit actors can survive sleep/wake, but the live VM and ACP agent process do not. This PR makes persisted Agent OS sessions resumable by rebuilding durable context from actor SQLite and rehydrating a live ACP session on demand.

Validation

  • git diff --check
  • pnpm --dir packages/core build
  • pnpm --dir website build
  • just secure-exec-status reports mode: pinned
  • Local managed-dependency scan shows no external @secure-exec/* or @agent-os-pkgs/* link: deps. The remaining pnpm-lock.yaml link: entries are local workspace packages in this repo.

Blocked locally:

  • cargo test -p agent-os-sidecar acp -- --test-threads=1 cannot resolve secure-exec-sidecar-browser from crates.io.
  • pnpm --dir packages/core exec vitest run tests/session-resume.test.ts tests/opencode-session.test.ts --reporter=verbose reaches the same Cargo resolver failure while building agent-os-sidecar.

The unresolved crate is not local-dev state: secure-exec-sidecar-browser is still listed in the workspace dependency manager and CI, but is not published on crates.io. That needs a secure-exec publish or a deliberate Agent OS browser-wrapper dependency change before Cargo validation can pass in fully pinned mode.

@railway-app

railway-app Bot commented Jun 20, 2026

Copy link
Copy Markdown

🚅 Environment agent-os-pr-1493 in rivet-frontend has no services deployed.

@NathanFlurry NathanFlurry changed the title [codex] finish session resume compatibility Finish ACP session resume and persistence docs Jun 20, 2026
NathanFlurry and others added 2 commits June 20, 2026 12:49
* feat(agentos): native actor plugin cdylib + @rivet-dev/agentos TS forwarder + tests

Rust plugin (crates/agentos-actor-plugin, cdylib): plugin side of
rivet-actor-plugin-abi; imports the UNMODIFIED agent-os-client, drives the
sidecar on its own tokio runtime, calls back into the host vtable for durable
storage + events. ABI exports + HostCtx bridge (incl. the required startup_ready
handshake), run loop + lazy VM lifecycle, full 24-op fs persistence + session
events, ~40-action dispatch (abi codec + encode_json_compat), config_json
deserializer, HTTP /preview proxy. Built end-to-end as a cdylib against the real
client + secure-exec.

Persistence e2e test (src/persistence_e2e.rs): drives the REAL handle_fs_call
dispatch (the VM's sqlite_vfs storage callback) through a mock HostVtable backed
by an in-memory rusqlite Connection, speaking the exact CBOR db_* wire contract
— migrate + mkdir/writeFile/exists/readFile/stat/readDir/removeFile round-trip.
Proves the durable-storage core against real SQLite, no VM/sidecar needed.
  cargo test -p agentos-actor-plugin

TS forwarder (packages/agentos, @rivet-dev/agentos): agentOs(config) ->
ActorDefinition whose nativeFactoryBuilder calls createNativePluginFactory
({pluginPath,configJson,sidecarPath}); buildConfigJson (lock-step with
config.rs), schema, nodeModulesMount, getPluginPath(), types.

Gated on infra (spec phases 2,5-7): publish abi + rivetkit + secure-exec; CI
dylib matrix; npm platform packages; live-VM e2e (needs the built sidecar).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agentos): default LLM egress allowlist + auto-mount agent node_modules

- session.rs: resolve renamed @rivet-dev/agentos-* agent packages (acpAdapter/agentPackage), fixing createSession("pi") on a verbatim install
- default network egress is now a deny-by-default allowlist of LLM provider hosts (anthropic/openai/gemini/openrouter) instead of allow-all; quickstart needs no permissions block
- forwarder auto-derives the /root/node_modules host_dir mount from agent descriptors' packageDir; quickstart needs no manual nodeModulesMount
- retains rivetkit preview c44621f + rivet-actor-plugin-abi 2.3.2

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(agentos): include common software by default (auto-injected)

@rivet-dev/agentos now depends on @agent-os-pkgs/common and the forwarder
auto-injects it into the software list (deduped against explicit entries) so the
quickstart is just software: [pi]. Opt out with options.defaultSoftware: false.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@NathanFlurry

Copy link
Copy Markdown
Member Author

Closing — the session-resume + persistence work in this branch already landed in main through the dylib/rename merges. Verified the contributing files (acp_extension.rs resume state machine, resumeSession in agent-os.ts, session-resume.test.ts, sessions-persistence.mdx) are byte-identical to main apart from the post-fork agent-os-sidecaragentos-sidecar / @agent-os-pkgs@agentos-software renames. This branch is ~11 commits behind main and has nothing main lacks; merging it would revert those renames and unrelated progress. No functionality lost by closing.

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