Skip to content

feat(agent): add delegated worktree threads - #346

Open
fcoury-oai wants to merge 1 commit into
mainfrom
fcoury/delegate-threads
Open

fcoury-oai wants to merge 1 commit into
mainfrom
fcoury/delegate-threads

Conversation

@fcoury-oai

Copy link
Copy Markdown
Collaborator

Delegated tasks need isolation without forcing the user to leave their current pair session or manually manage another Red instance.

This change adds Pair and Delegate modes to the existing Agent experience. Delegate mode previews and creates a sibling Git worktree, starts a Codex conversation rooted there, and leaves the current Pair thread selected. A new Threads workspace groups conversations by attention, failure, running, review-ready, current, and historical state, and selecting a thread reuses the Agent pane.

Agent conversations now persist as a collection, carry their own workspace roots and branch metadata, and keep editor tools scoped to the owning session. This prevents a delegated task from reading or following the active Pair buffer while still allowing multiple sessions to share the existing Codex app-server connection.

How to Test

  1. Open the Agent pane and choose New → Pair in this workspace. Start a prompt, then create another Pair conversation and confirm the previous thread remains available under Threads.
  2. Choose New → Delegate in a worktree, enter a task, and confirm the preview shows the derived branch and sibling worktree before anything is created.
  3. Accept the preview. Confirm the delegated task starts in the background, the current Pair thread remains selected, and Threads shows the delegate as Running before moving it to Ready to review when the turn completes.
  4. Select the delegated thread from Threads. Confirm the Agent pane loads its transcript and follow-up prompts remain scoped to the delegated worktree.
  5. Exercise the non-happy path by attempting a delegate whose derived branch or worktree already exists. Confirm Red reports the Git failure and does not replace the active Pair conversation.

Targeted automated coverage includes the Agent plugin mode picker and delegate preview, multi-session root isolation and status transitions, session persistence, and Codex session cwd routing.

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.

1 participant