Repository navigation
feat(server): run the setup script in every repo of a multi-repo worktree - #328
Merged
LoganRupe merged 1 commit intoSep 30, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Terminal ID truncation can collide and stop earlier repository setup processes.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Runs setup scripts across every repository in multi-repo worktrees.
Changes:
- Launches and tracks per-repository setup terminals.
- Adds repository-labelled output, failures, and cancellation.
- Exposes
T3CODE_REPO_ROOTand adds multi-repo coverage.
| File | Description |
|---|---|
apps/server/src/ws.ts |
Coordinates multi-repo setup execution and tracking. |
apps/server/src/server.test.ts |
Tests multi-repo setup behavior. |
apps/server/src/project/ProjectSetupScriptRunner.ts |
Adds repository environment and terminal suffix support. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+356
to
+360
| const terminalId = | ||
| input.preferredTerminalId ?? | ||
| (input.terminalIdSuffix | ||
| ? `setup-${script.id}-${input.terminalIdSuffix}`.slice(0, 128) | ||
| : `setup-${script.id}`); |
| const env = projectScriptRuntimeEnv({ | ||
| project: { cwd: project.workspaceRoot }, | ||
| worktreePath: input.worktreePath, | ||
| ...(input.repoRoot ? { extraEnv: { T3CODE_REPO_ROOT: input.repoRoot } } : {}), |
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.


What Changed
A multi-repo isolated run now starts the project's setup script in every repo's worktree, not just the first one.
setup-<id>and the others getsetup-<id>-<repo>.[repo], and failures name the repo (web: exit 1). A script not marked async holds the agent until every repo finishes. Cancel closes every setup terminal.T3CODE_REPO_ROOT, which points at the repo's original checkout. A multi-repo project'sT3CODE_PROJECT_ROOTis the folder holding the.code-workspacefile, so before this a script couldn't find the repo to copy.env*from.Single-repo runs are unchanged.
Why
Cousin repos came up with no
.envand no dependencies, so the agent spent its first minutes on setup in every repo after the first. Tools like spawnpoint solve this outside T3. This change makes the setup script we already have cover every repo instead.Every repo runs the same script. A script that needs to differ per repo can branch on files or on
T3CODE_REPO_ROOT.UI Changes
compare.mp4
Before: the card only shows
setting up api, and there's one setup terminal. After:[api]and[web]both run, each in its own terminal.