Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a merge settles every thread in the PR's worktree again #43264

Opennikalezah(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/43264/headopened View on GitHub

Showing 2 changed files with 75 additions and 11 deletions.

x
0 of 2 viewed, 2 left
53 additions and 0 deletionsapps/server/src/orchestration-v2/ThreadSettlementService.test.tsModified
View file
@@ -2337,6 +2337,59 @@
}).pipe(Effect.provide(fixture.layer));
+ it.effect("a merge settles the threads in another thread's PR worktree, not local ones", () =>
+ Effect.gen(function* () {
+ yield* TestClock.setTime(Date.parse(NOW));
+ const link = persistedLink("open", DateTime.makeUnsafe("2026-08-20T00:00:00.000Z"));
+ const worktree = {
+ branch: "feature",
+ worktreePath: "/worktrees/feature",
+ createdAt: DateTime.makeUnsafe("2026-08-27T00:00:00.000Z"),
+ latestUserMessageAt: DateTime.makeUnsafe("2026-08-27T00:00:00.000Z"),
+ };
+ const owner = makeThread("pr-owner", {
+ ...worktree,
+ pullRequests: [
+ { ...link, snapshot: { ...link.snapshot!, state: "merged", mergedAt: NOW } },
+ ],
+ });
+ const sibling = makeThread("worktree-sibling", worktree);
+ const localSibling = makeThread("local-sibling", { ...worktree, worktreePath: null });
+ const cachedSibling = makeThread("cached-worktree-sibling", {
+ ...worktree,
+ branchPullRequest: {
+ projectId: PROJECT_ID,
+ repository: "owner/repository",
+ number: 42,
+ url: "https://example.test/owner/repository/pull/42",
+ },