Repository navigation
feat: copy selected history context for workspace handoff - #52
Merged
johnnyhuy merged 1 commit intoNov 12, 2026
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
johnnyhuy
deleted the
ao/pidex-development-3/agent/issue-51-copy-history-context
branch
November 12, 2026 16:32
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.
Adds Copy context beside Export in session history. It copies the selected parent chain through the existing Markdown formatter, including the root, model, messages, thinking, tool input/output and handoff guidance. Users can paste it into a new session in another root.
Both actions wait for readable history. Clipboard success explains the next step; failures stay retryable and offer Export. Selecting another branch or entry clears the feedback. Saved archives stay in their original root.
Part of #4
Closes #51
Verification
bun install --frozen-lockfilepassed.bun run lintandbun run typecheckpassed.bun run test:unitpassed, 90 tests.bun run test:integrationpassed, 56 tests, including five new HistoryExport cases covering exact Markdown, empty/unavailable history, pending-copy suppression, retry after failure, unavailable clipboard and file download.mise run buildpassed.mise exec -- bun run test:e2epassed, 46 tests across five Electron suites.Proof
The new Electron test,
copies only the selected history path as portable context without launching Pi, reads the native Electron clipboard after copying the archive tip, another branch and an ancestor. It verifies excluded branch/descendant text is absent, the source archive is unchanged and no Pi process was opened.Captured locally, outside the commit:
.tmp/proof/e2e.txtcontains the full Electron run output..tmp/proof/copied-history-context.pngshows the actual selected ancestor, Copy context control and paste guidance. Visually inspected..tmp/proof/history-export-tests.txtnames the five passing component tests..tmp/proof/build.txtcontains the production build and gate output.The local Electron installation needed repair with the pinned Node 22 runtime before E2E could launch. The successful run uses deterministic Pi RPC fixtures; live-provider behaviour and archive relocation are outside this slice.
Hosted proof