Skip to content

Group threads across repos into one multi-repo task with linked PRs - #1630

Merged
currentbits merged 2 commits into
mainfrom
coder/multi-repo-coordinated-changes-one-task--868894
Oct 13, 2026
Merged

currentbits merged 2 commits into
mainfrom
coder/multi-repo-coordinated-changes-one-task--868894

Conversation

@currentbits

Copy link
Copy Markdown
Owner

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):
    • taskGroupSiblings returns the other non-trashed members of a thread's group, each with its project.
    • taskGroupNoteFor builds 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.
    • withTaskGroupFooter adds 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: createThread accepts taskGroupFrom. 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 through withTaskGroupFooter. This happens before the outbound-secrets check.

Renderer (src/)

  • taskGroup.ts (new): pure helpers.
    • taskGroupRollup returns 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.
    • taskRepoTargets returns the non-scratch projects that aren't already in the task.
  • ThreadView:
    • The thread menu gets a "Continue task in another repo" / "Add repo to task" section that lists those target projects.
    • The thread view shows a "Multi-repo task" banner with the repo count, how many PRs are merged, and one row per member. Each row has a link to that thread and to its PRs.
  • 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.
  • IPC types: ThreadInfo.taskGroupId? and the createThread option taskGroupFrom?, passed through useCoderRuns.

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

Solenta-Message-Id: dcb9fc4e-8294-4de1-96c7-6634e5ff58ec
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T14:37:00.077471Z 71348dd PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +218 to +221
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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +216 to +220
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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@currentbits
currentbits merged commit 90ef80b into main Oct 13, 2026
6 checks passed
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