Repository navigation
feat: prepare retained exited-session context in another workspace root - #96
Merged
Merged
Conversation
Exited tabs can copy and export their retained transcript, but Continue in another root needed saved history. Offer the same explicit draft preparation directly from an exited tab, even when no archive exists. Reuse the existing destination form and the retained snapshot Markdown. Keep existing destination text and the source's unsent draft separate. Identify the handoff as a potentially incomplete window snapshot with no resumable selection claim. Prepare only in an available, different registered root, without opening Pi, sending prompts or reading an archive. Bound the exit recovery area at short window heights so the transcript stays readable while the form is open. Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
This was referenced Nov 30, 2026
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.
What changed
An exited tab now offers Continue in another root, the same explicit draft preparation that saved history already had. The retained transcript is prepared as a new-session draft in another registered root, with no archive present, no Pi launched and no prompt sent. Existing destination text is kept and the source's unsent draft stays in its own tab.
Part of #4. Closes #94.
Scope
prepareHandoffnow accepts an exited session as its source, reusing the destination form and the retained snapshot Markdown.openSessionis exposed on the workbench hook so the empty-transcript guard is directly testable.How it was verified
The Playwright e2e run reached every assertion in this slice, including the new Electron case.
New tests
tests/integration/useWorkbench.test.tsxprepares an exited snapshot without an archive and preserves both roots draftsrejects unavailable or same-root exited handoffs and live or empty transcriptstests/integration/ExitedSessionExport.test.tsxcopies context without an archive path and keeps the unsent draft separate(extended with the handoff flow)tests/e2e/session-activity.test.tsprepares an exited snapshot in another root without launching Pi, even with a missing archiveProof
The Electron test drives the real app: it removes the exact exited archive so no saved history is present, opens the handoff form on the exited tab, prepares the draft in another root and returns to the source tab. It checks the prepared text, the preserved destination and source drafts, the absence of any new session RPC and the absence of the archive file.
Captured and visually inspected:
.tmp/proof/exited-session-handoff.png(1280 x 840). The exit recovery form is open on an exited tab with no archive present. The form says the window snapshot may be incomplete, and the destination root is offered in the select..tmp/proof/exited-session-handoff-minimum.png(900 x 600). The recovery area scrolls inside its own bound and the transcript keeps 84 pixels of height rather than collapsing to 4..tmp/proof/exited-session-prepared-draft.png(1280 x 840). The destination root's composer holds the existing task, a separator and the retained transcript. Pi has not started, so the status reads PI READY.The same captures are uploaded by the Electron CI run in the pidex-e2e artefact, from
test-results/session-activity/. Run: https://github.com/echohello-dev/pidex/actions/runs/46330435916What the reviewer should know
origin/mainas well and are unrelated to this slice.tests/integration/SettingsView.test.tsxhas six failures becauselocalStorageis undefined in the test environment.tests/unit/workbench.test.tshas git-timeout flakes on a 5 second limit under machine load. Both were reproduced on a clean checkout, where the unit file failed more often than it does here..wb-conversationmirrors the existing.wb-history-conversationrules. Without it the exit recovery form squeezed the transcript to 4 pixels at 900 by 600.ELECTRON_RUN_AS_NODEunset, because the harness environment sets it and it makes Electron run as plain Node.