Skip to content

Session export/import — portable bundles, idempotent import, dir remap (#291) - #292

Draft
aarontrowbridge wants to merge 1 commit into
local/amicodefrom
aaron/session-export-import
Draft

Session export/import — portable bundles, idempotent import, dir remap (#291)#292
aarontrowbridge wants to merge 1 commit into
local/amicodefrom
aaron/session-export-import

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Closes #291.

What

Storage-layer session portability for the fleet's store split:

  • opencode export session <id[,id2,…]> | --all [-o out.jsonl] — JSONL bundle, one raw row per line (session / message / part), byte-faithful to the storage layer, IDs + timestamps verbatim, stable ordering (session → messages by (time_created, id) → parts by id).
  • opencode import session <bundle> [--remap-dir from=to …] — idempotent by session ID (existing = skipped, exit 0); remap rewrites the project directory at import; non-matching keep their original path; FK-safe project bucketing with fallback.
  • Documented single-writer (per-session transaction; SQLite WAL + busy_timeout for readers).

Gates (director-run)

  • bun test (bundle + storage): 23 pass / 0 fail (own run)
  • Implementer full run: 403 pass incl. cli/storage/help-snapshots; tsc --noEmit clean (packages/opencode); oxlint clean; E2E: export repo A → import repo B with remap → re-import skipped.
  • Touched only packages/opencode — no app/UI packages (another stream owns fork UI right now).

Use cases

One-time store merge (MacBook 560 MB local → hub canonical), and the "sessions to go" offline story (amicode#792's deferred piece).

Draft pending the fork UI stream's release (no-merge-while-churning posture).

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Session export/import — portable bundles for store merge + sessions-to-go

1 participant