Skip to content

feat: prepare history context in another workspace root - #56

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-55-history-handoff-draft
Nov 13, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-55-history-handoff-draft

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

History can now prepare the selected branch or ancestor as a Markdown draft in another registered root. Preparing keeps existing destination text and the source history selection; Pi starts only after the user reviews and sends the draft.

Part of #4
Closes #55

Verification

  • mise exec -- bun install --frozen-lockfile passed.
  • mise exec -- bun run lint passed.
  • mise exec -- bun run typecheck passed.
  • mise exec -- bun run test:unit passed, 90 tests.
  • mise exec -- bun run test:integration passed, 65 tests.
  • mise run build passed, including all checks and production bundling.
  • mise exec -- bun run test:e2e passed, 48 tests across five Electron suites.
  • git diff --check passed.

Proof

$ mise exec -- bun run test:unit
 Test Files  10 passed (10)
      Tests  90 passed (90)

$ mise exec -- bun run test:integration
 Test Files  12 passed (12)
      Tests  65 passed (65)

$ mise exec -- bun run test:e2e
 Test Files  5 passed (5)
      Tests  48 passed (48)

The new Electron test, prepares ancestor context in another root without starting Pi and sends only after review, checks the native disabled destination option, ancestor-only context, preservation of both drafts and the source archive, absence of runtime opens/prompts before Send, and the exact edited prompt sent to a fresh destination session. Playwright captures the selected destination and prepared composer. Both local PNGs were visually inspected.

New component coverage includes the following cases.

  • requires an available destination and prepares only on explicit submit
  • rejects a destination that becomes unavailable while the form is open
  • explains how to add a destination when no other roots are registered
  • prepares selected history across groups, keeps both drafts and restores the source selection
  • does not prepare missing, same-root, empty or loading history handoffs

Captures are in .tmp/proof/select-destination.png and .tmp/proof/prepared-destination-draft.png. The Electron suite also writes them under test-results/history-handoff/ for the existing pidex-e2e CI artefact upload. Download the hosted Electron screenshot artefact. Both images were checked in the downloaded CI artefact, under Users/runner/work/pidex/pidex/test-results/history-handoff/.

Direct inline attachment is blocked here. The browser automation host timed out, and the native Firefox file chooser did not confirm the selected file. Screenshot capture in Electron succeeded. Scratch captures and logs are excluded from the commit.

Drafts remain in memory and do not survive app quit. Handoff carries the same full selected history, including thinking and tool input/output, as Copy context and Export. It does not move files or session archives. Further recovery work stays under #4.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy marked this pull request as ready for review November 13, 2026 01:53
@johnnyhuy
johnnyhuy merged commit a60c439 into main Nov 13, 2026
15 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-55-history-handoff-draft branch November 13, 2026 01:53
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.

Prepare selected history as a draft in another workspace root

1 participant