feat: persist AI sessions across box lifecycles - #7
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds per-project, owner-only persistence for AI agent session state so disposable Devbox clones can be deleted and recreated without losing resumable conversations, while keeping credentials and unrelated host histories out of the persisted store. It introduces an opt-out for ephemeral session runs, plus commands to inspect/clear the per-project session directory, and updates docs/tests for the new behavior.
Changes:
- Add persistent per-project session store mounting/linking for Claude Code, Codex (incl. proxy profile), OpenCode, Pi, and Stado; add
--ephemeral-sessions/-eto opt out per run. - Add
devbox sessions path|clear [--yes] [DIR]to inspect and explicitly delete the retained per-project store. - Update tests and documentation; bump version to v1.2.0 and document release notes.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| VERSION | Bumps version to 1.2.0. |
| test/e2e.sh | Ensures E2E cleanup clears persisted session state. |
| test/devbox.bats | Adds unit tests for session directory derivation, permissions, CLI flag, and sessions path/clear. |
| README.md | Documents session continuity, trust boundary, new flag, and new sessions subcommand. |
| docs/index.html | Updates website copy for v1.2.0 and mentions session persistence / flags. |
| docs/agent-capabilities-security.md | Expands security docs to cover persistent session state and the --ephemeral-sessions mitigation. |
| CHANGELOG.md | Adds v1.2.0 changelog entry describing session persistence and new commands. |
| bin/devbox | Implements persistent session store, mounting/linking logic, opt-out flag, and sessions subcommand. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
--ephemeral-sessions/-eanddevbox sessions path|clearUser impact
A project can delete and recreate its disposable VM while retaining resumable AI conversations. Users can explicitly opt out or clear the exact project store.
Safety
The store is owner-only, keyed by canonical project path, rejects unsafe roots, and cannot be attached to two differently named boxes concurrently. Existing OpenCode databases are preserved on conflict rather than overwritten.
Validation
make test— 87 Bats tests and 33 Python testsmake lintbash -n bin/devbox test/e2e.shgit diff --checkgitleaks protect --staged --redact --verbose