feat(sessions): fork + fork-into-worktree (F1/W1/FW)#26
Merged
Conversation
The install_progress_rx/host_label params added on the stage2 branch never reached the four cfg(test) call sites, so the whole -p warp test binary failed to build. cargo check does not compile cfg(test) code, which is why the PR gate missed it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…(F1/W1/FW) From any live session in the cockpit dashboard, two row actions branch a copy of the conversation into a new block; the original session stays untouched (fork/worktree design §2-3): - CLIAgent::fork_command, verified against both CLIs on 2026-07-03: `claude --resume <id> --fork-session`, `codex fork <id>`; other agents return None and get no surface (no fake fork). fork_command_pinned prepends CLAUDE_CONFIG_DIR/CODEX_HOME as inline env for non-default accounts — one string that works in local tabs, worktree configs, and (later, W2) daemon startup_commands, with the pinning visible. - WorkspaceAction::ForkAgentSession → workspace fork_agent_session: plain fork opens a tab in the source cwd and queues the fork command (the SSH-launch pattern); fork-into-worktree builds a one-shot worktree tab config (autogenerated branch from HEAD, fork command appended after the cd) and opens it without persisting — a fork is a moment, not a template. git errors stay visible as the session's first output. - build_worktree_config_toml gains an optional followup_command, appended after the cd in both naming modes. - Cockpit dashboard session rows: "⑂ fork" / "⑂ +worktree" hover actions; the worktree variant only appears when the session's cwd is inside a git repo (precomputed on cockpit updates — render never touches the filesystem); stable per-session MouseStateHandles. Verified: cargo check -p warp 0 errors/0 warnings; targeted suites green (fork_command 3, build_worktree_toml 3, daemon_tty 7). Runtime acceptance needs the next user test build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ktree # Conflicts: # app/i18n/en/warp.ftl # app/src/cockpit/pane.rs
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.
Implements F1, W1 and FW of the fork/worktree design (
docs/superpowers/specs/2026-07-03-agent-session-fork-and-worktree-launch-design.md):claude --resume <id> --fork-session,codex fork <id>.CLIAgent::fork_commandreturnsNonefor everything else — no surface, no fake fork.fork_command_pinnedprependsCLAUDE_CONFIG_DIR/CODEX_HOMEas inline env for non-default accounts (one string that also works in worktree configs and, later, daemonstartup_commands).WorkspaceAction::ForkAgentSession: plain fork opens a tab in the source session's cwd and queues the fork command (the SSH-launch pattern); fork-into-worktree builds a one-shot worktree tab config (autogenerated branch from HEAD, fork command appended after thecd) and opens it without persisting it to the tab-config dir.git worktree addfailures stay visible as the session's first output.⑂ fork/⑂ +worktreehover actions; the worktree variant only renders when the cwd is inside a git repo (precomputed on cockpit updates, render never touches the filesystem).EventLoop::starttest callers were missing theinstall_progress_rx/host_labelparams from PR feat(remote-session): Stage 2 client-attach (part 1: client protocol) [draft] #16, so the whole-p warptest binary failed to build (cargo checkdoesn't compilecfg(test)code, which is why the gate missed it). Repaired in its own commit.Open (design status header updated): W2 remote worktree via daemon
startup_command(natural anchor: C4 launcher), block-header surface, Codex surface (waits on Codex session discovery — the fork mechanics are ready).Verified:
cargo check -p warp0 errors/0 warnings; targeted suites green (fork_command 3, build_worktree_toml 3, daemon_tty 7). Runtime acceptance lands with the next user test build — none triggered per instruction.🤖 Generated with Claude Code