Repository navigation
Group threads across repos into one multi-repo task with linked PRs - #1630
Conversation
Solenta-Message-Id: dcb9fc4e-8294-4de1-96c7-6634e5ff58ec
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71348ddcce
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (input.taskGroupFrom != null) { | ||
| if (!groupSource) throw new Error(`Unknown thread: ${input.taskGroupFrom}`); | ||
| if (project.scratch === true) { | ||
| throw new Error("Scratch has no repo to add to a multi-repo task"); |
There was a problem hiding this comment.
Reject Scratch threads as task-group sources
When taskGroupFrom identifies a thread in the Scratch workspace and the destination is a real project, this check succeeds because it only examines the destination. The renderer offers exactly this flow from a selected Scratch thread, after which the banner counts Scratch as a repo and the runner tells the new agent that Scratch owns another repository even though it has none. Reject the group when the source project is Scratch as well.
Useful? React with 👍 / 👎.
| const groupSource = | ||
| input.taskGroupFrom != null ? store.getThread(input.taskGroupFrom) : null; | ||
| if (input.taskGroupFrom != null) { | ||
| if (!groupSource) throw new Error(`Unknown thread: ${input.taskGroupFrom}`); | ||
| if (project.scratch === true) { |
There was a problem hiding this comment.
Reject duplicate repositories in a task group
When the destination project already has a thread in the source's task group, this validation still creates another member for the same repo. Although the renderer normally filters such targets, concurrent creates or direct threads.create calls can reach this path and violate the stated one-thread-per-repo invariant, causing the prompt and PR footer to report multiple owners for one repository. Validate the target project against all existing group members before persisting the thread.
Useful? React with 👍 / 👎.
What
Adds multi-repo tasks (#263). A single task can now span several repos, with one thread per repo, all grouped under a shared
taskGroupId. Each thread still writes only to its own project, so the #109 rule that a run never writes to a second repo still holds. The group is bookkeeping plus extra context for the agent.Backend (
electron/)taskGroups.js(new):taskGroupSiblingsreturns the other non-trashed members of a thread's group, each with its project.taskGroupNoteForbuilds a standing prompt note that lists the sibling threads, their repos, their status and their PRs. It tells the agent to change only its own repo, to stay out of sibling checkouts, and to list the sibling PRs in its own PR description. Sibling paths are left out on purpose.withTaskGroupFooteradds a "Part of a multi-repo change" footer to a PR body. It names each sibling's PR, or says "PR not opened yet", and skips refs the body already contains.services-threads.js:createThreadacceptstaskGroupFrom. The new thread joins that thread's group, and if the source thread had no group, its own id becomes the group id. It throws for an unknown source thread or for the Scratch project.runner.js/services.js: the task-group note is added to the dispatch prompt next to the crew-task note.worktrees-pr.js: GitHub and GitLab PR/MR creation now passes the body throughwithTaskGroupFooter. This happens before the outbound-secrets check.Renderer (
src/)taskGroup.ts(new): pure helpers.taskGroupRollupreturns the members, each one's project, status and PRs, plus a merged/total PR count. It returns null unless the group has at least two members.taskRepoTargetsreturns the non-scratch projects that aren't already in the task.ThreadView:App.tsx/useThreadRoster: the menu action creates the sibling thread with the source thread's title and reveals it. The roll-up is memoised on a value key, so stream ticks on unrelated threads keep the same object identity.ThreadInfo.taskGroupId?and thecreateThreadoptiontaskGroupFrom?, passed throughuseCoderRuns.Tests
electron/test/task-groups.test.js: group creation and joining, the Scratch and unknown-thread rejections, the prompt note, and the PR footer.test/taskGroup.test.tsx: the roll-up and repo-target helpers, plus the banner and menu rendering.🤖 Generated with Claude Code