Skip to content

feat: persist AI sessions across box lifecycles - #7

Merged
foobarto merged 1 commit into
mainfrom
agent/session-persistence-v1.2.0
Aug 15, 2026
Merged

feat: persist AI sessions across box lifecycles#7
foobarto merged 1 commit into
mainfrom
agent/session-persistence-v1.2.0

Conversation

@foobarto

Copy link
Copy Markdown
Owner

Summary

  • persist native Claude Code, Codex, OpenCode, Pi, and Stado session state per project across disposable Devbox lifecycles
  • keep credentials, provider keys, configuration, and unrelated host histories outside the session store
  • add --ephemeral-sessions / -e and devbox sessions path|clear
  • document the cross-lifecycle trust boundary and publish the change as v1.2.0

User 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 tests
  • make lint
  • bash -n bin/devbox test/e2e.sh
  • git diff --check
  • gitleaks protect --staged --redact --verbose
  • live two-clone persistence proof
  • live kept-box detach proof
  • live OpenCode database-on-mount proof

Copilot AI lite review requested due to automatic review settings August 15, 2026 10:05
@foobarto
foobarto merged commit d037fa2 into main Aug 15, 2026
1 check passed
@foobarto
foobarto deleted the agent/session-persistence-v1.2.0 branch August 15, 2026 10:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/-e to 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.

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.

2 participants