feat: new branches use the shorter t3/ prefix (#16220)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-05 15:34:37 -07:00
1 parent cbb731beb3
commit 2afe87ea4b
9 files changed
+59 -53

No files matched your search

@@ -1104,7 +1104,7 @@ it.effect("names the worktree itself when the client provides no branch", () =>
yield* waitUntil(() => Effect.sync(() => harness.createWorktree.mock.calls.length === 1));
assert.match(
harness.createWorktree.mock.calls[0]?.[0]?.newRefName ?? "",
/^t3code\/[0-9a-f]{8}$/u,
/^t3\/[0-9a-f]{8}$/u,
);
yield* waitUntil(() =>
threads
@@ -1115,7 +1115,7 @@ it.effect("names the worktree itself when the client provides no branch", () =>
}),
);
it.effect("renames a temporary t3code/<hash> branch off the provisioning critical path", () =>
it.effect("renames a temporary t3/<hash> branch off the provisioning critical path", () =>
Effect.gen(function* () {
const branchNameStarted = yield* Deferred.make<void>();
const allowBranchName = yield* Deferred.make<void>();
@@ -1138,11 +1138,11 @@ it.effect("renames a temporary t3code/<hash> branch off the provisioning critica
command: "command:launch:temp-branch",
thread: "thread:launch:temp-branch",
message: "Build the feature",
workspace: { type: "worktree", baseRef: "main", branch: "t3code/abcd1234" },
workspace: { type: "worktree", baseRef: "main", branch: "t3/abcd1234" },
}),
);
yield* Deferred.await(branchNameStarted);
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3code/abcd1234");
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3/abcd1234");
yield* waitUntil(() =>
threads
.getThreadProjection(launched.threadId)
@@ -1150,7 +1150,7 @@ it.effect("renames a temporary t3code/<hash> branch off the provisioning critica
);
assert.equal(
(yield* threads.getThreadProjection(launched.threadId)).thread.branch,
"t3code/abcd1234",
"t3/abcd1234",
);
yield* Deferred.succeed(allowBranchName, undefined);
yield* waitUntil(() =>
@@ -1160,17 +1160,17 @@ it.effect("renames a temporary t3code/<hash> branch off the provisioning critica
);
assert.deepEqual(harness.renameBranch.mock.calls[0]?.[0], {
cwd: "/repo-worktrees/temp",
oldBranch: "t3code/abcd1234",
oldBranch: "t3/abcd1234",
newBranch: "generated-branch",
});
}).pipe(Effect.provide(harness.layer));
}),
);
it.effect("provisions under t3code-<hash> when a plain t3code branch blocks t3code/*", () =>
it.effect("provisions under t3-<hash> when a plain t3 branch blocks t3/*", () =>
Effect.gen(function* () {
const harness = makeHarness({
hasCommit: (input) => Effect.succeed(input.refName === "refs/heads/t3code"),
hasCommit: (input) => Effect.succeed(input.refName === "refs/heads/t3"),
createWorktree: (input) =>
Effect.succeed({
worktree: { path: "/repo-worktrees/temp", refName: input.newRefName, headSha: "abc" },
@@ -1184,7 +1184,7 @@ it.effect("provisions under t3code-<hash> when a plain t3code branch blocks t3co
command: "command:launch:blocked-namespace",
thread: "thread:launch:blocked-namespace",
message: "Build the feature",
workspace: { type: "worktree", baseRef: "main", branch: "t3code/abcd1234" },
workspace: { type: "worktree", baseRef: "main", branch: "t3/abcd1234" },
}),
);
yield* waitUntil(() =>
@@ -1192,8 +1192,8 @@ it.effect("provisions under t3code-<hash> when a plain t3code branch blocks t3co
.getThreadProjection(launched.threadId)
.pipe(Effect.map((projection) => projection.thread.branch === "generated-branch")),
);
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3code-abcd1234");
assert.equal(harness.renameBranch.mock.calls[0]?.[0]?.oldBranch, "t3code-abcd1234");
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3-abcd1234");
assert.equal(harness.renameBranch.mock.calls[0]?.[0]?.oldBranch, "t3-abcd1234");
}).pipe(Effect.provide(harness.layer));
}),
);
@@ -1235,11 +1235,11 @@ it.effect("keeps the temporary branch when branch generation fails", () =>
command: "command:launch:branch-fallback",
thread: "thread:launch:branch-fallback",
message: "Build the feature",
workspace: { type: "worktree", baseRef: "main", branch: "t3code/abcd1234" },
workspace: { type: "worktree", baseRef: "main", branch: "t3/abcd1234" },
}),
);
yield* waitUntil(() => Effect.sync(() => harness.generateBranchName.mock.calls.length === 1));
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3code/abcd1234");
assert.equal(harness.createWorktree.mock.calls[0]?.[0]?.newRefName, "t3/abcd1234");
yield* waitUntil(() =>
threads
.getThreadProjection(launched.threadId)
@@ -1248,7 +1248,7 @@ it.effect("keeps the temporary branch when branch generation fails", () =>
assert.equal(harness.renameBranch.mock.calls.length, 0);
assert.equal(
(yield* threads.getThreadProjection(launched.threadId)).thread.branch,
"t3code/abcd1234",
"t3/abcd1234",
);
}).pipe(Effect.provide(harness.layer));
}),
@@ -1267,8 +1267,8 @@ it.effect("renames a temporary branch on an existing worktree to a generated nam
message: "Build the feature",
workspace: {
type: "existing_worktree",
worktreePath: "/repo-worktrees/t3code-abcd1234",
branch: "t3code/abcd1234",
worktreePath: "/repo-worktrees/t3-abcd1234",
branch: "t3/abcd1234",
},
}),
);
@@ -1278,8 +1278,8 @@ it.effect("renames a temporary branch on an existing worktree to a generated nam
.pipe(Effect.map((projection) => projection.thread.branch === "generated-branch")),
);
assert.deepEqual(harness.renameBranch.mock.calls[0]?.[0], {
cwd: "/repo-worktrees/t3code-abcd1234",
oldBranch: "t3code/abcd1234",
cwd: "/repo-worktrees/t3-abcd1234",
oldBranch: "t3/abcd1234",
newBranch: "generated-branch",
});
}).pipe(Effect.provide(harness.layer));
@@ -304,7 +304,7 @@ const make = Effect.gen(function* () {
});
// The server owns worktree naming: without an explicit branch, provision
// under a temporary `t3code/<hash>` name so the worktree never waits on
// under a temporary `t3/<hash>` name so the worktree never waits on
// name generation, then rename in the background below.
const requestedBranch = input.workspaceStrategy.branch;
let branch: string | null;