Skip to content

Fork agent sessions from terminal context menu - #3976

Merged
AmethystLiang merged 2 commits into
mainfrom
feature-fork-existing-agent-sessions-context-bra
May 31, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
feature-fork-existing-agent-sessions-context-bra

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

partially fix #2026

Summary

  • Adds a terminal context menu action and dialog to fork an existing agent session into a new top-level workspace.
  • Captures bounded terminal scrollback, cleans control sequences, and seeds the forked agent with the captured context as a draft prompt.
  • Creates fork worktrees from valid git workspaces, with clipboard fallback when the source agent cannot be resolved or launch planning fails.
  • Adds local and SSH-aware trust preflight for Codex, Cursor, and Copilot agent launches, including remote trust artifact writes.
  • Handles SSH/WSL launch platform selection and avoids oversized inline Windows draft startup commands.
  • Adds telemetry/source values for terminal context menu launches and stabilizes the SSH hook e2e helper timing.

Testing

  • Added unit coverage for fork prompt construction, fork workspace/launch behavior, dialog busy-state handling, remote trust writes, and launch platform/draft fallback behavior.
  • Updated SSH localhost e2e helper to preserve hook routing assertions.

- Add a terminal action to create a top-level workspace fork with captured agent context
- Pre-mark local and SSH agent trust before launching forked Codex/Cursor/Copilot sessions
- Use remote/Linux startup behavior for SSH and WSL forks, with Windows draft size fallback
- Cover fork prompt cleanup, launch behavior, remote trust writes, and dialog busy-state tests
@AmethystLiang
AmethystLiang merged commit f0448fa into main May 31, 2026
1 check passed
@nwparker nwparker added the risk:medium Medium risk change label May 31, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
- Add a terminal action to create a top-level workspace fork with captured agent context
- Pre-mark local and SSH agent trust before launching forked Codex/Cursor/Copilot sessions
- Use remote/Linux startup behavior for SSH and WSL forks, with Windows draft size fallback
- Cover fork prompt cleanup, launch behavior, remote trust writes, and dialog busy-state tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium Medium risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Fork existing agent sessions (context branching)

2 participants