Session export/import — portable bundles, idempotent import, dir remap (#291) - #292
Draft
aarontrowbridge wants to merge 1 commit into
Draft
Session export/import — portable bundles, idempotent import, dir remap (#291)#292aarontrowbridge wants to merge 1 commit into
aarontrowbridge wants to merge 1 commit into
Conversation
…nt import + dir remap (#291)
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
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.Gates (director-run)
bun test(bundle + storage): 23 pass / 0 fail (own run)tsc --noEmitclean (packages/opencode); oxlint clean; E2E: export repo A → import repo B with remap → re-import skipped.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).