@devries-cameron20 / t3code Mirror · read-only / commits / eeb31c11b7
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 22:15 UTC

fix(server): settling a thread refreshes its pull request status once (#33095)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Bilal Bakr committed Nov 12, 2026 at 02:05 UTC eeb31c11b78fb1a1ba43a6441353223b74aa8275
3 files changed +45 -2
apps/server/src/orchestration-v2/PullRequestSyncReactor.test.ts
+41 -1
@@ -1261,7 +1261,7 @@ describe("PullRequestSyncReactor", () => {
1261 ),
1262 );
1263
1264 - it.effect("leaves a settled thread's links unread until the thread is unsettled", () =>
1264 + it.effect("reads a settled thread's links once when it settles, then until unsettled", () =>
1265 Effect.scoped(
1266 Effect.gen(function* () {
1267 yield* TestClock.setTime(Date.parse(NOW));
@@ -1281,6 +1281,46 @@ describe("PullRequestSyncReactor", () => {
1281
1282 yield* Effect.gen(function* () {
1283 const reactor = yield* startAndSweep(fixture);
1284 + assert.deepStrictEqual(yield* Ref.get(fixture.summaryCalls), []);
1285 +
1286 + const threadId = ThreadId.make("settled");
1287 + const at = DateTime.makeUnsafe(NOW);
1288 + yield* Queue.offer(fixture.domainEvents, {
1289 + type: "thread.settled",
1290 + id: EventId.make("event:settled"),
1291 + threadId,
1292 + occurredAt: at,
1293 + payload: {
1294 + createdBy: "user",
1295 + creationSource: "web",
1296 + id: threadId,
1297 + projectId: PROJECT_ID,
1298 + title: "settled",
1299 + providerInstanceId: ProviderInstanceId.make("codex"),
1300 + modelSelection: { instanceId: ProviderInstanceId.make("codex"), model: "gpt-5" },
1301 + runtimeMode: "full-access",
1302 + interactionMode: "default",
1303 + branch: null,
1304 + worktreePath: null,
1305 + activeProviderThreadId: null,
1306 + lineage: { parentThreadId: null, relationshipToParent: null, rootThreadId: threadId },
1307 + forkedFrom: null,
1308 + createdAt: at,
1309 + updatedAt: at,
1310 + archivedAt: null,
1311 + settledOverride: "settled",
1312 + settledAt: at,
1313 + lastVisitedAt: null,
1314 + deletedAt: null,
1315 + },
1316 + });
1317 + yield* Queue.take(fixture.snapshotReads);
1318 + yield* Queue.take(fixture.snapshotReads);
1319 + yield* reactor.drain;
1320 + assert.deepStrictEqual(
1321 + (yield* Ref.getAndSet(fixture.summaryCalls, [])).map((call) => call.number).toSorted(),
1322 + [5, 6],
1323 + );
1324 for (let index = 0; index < 15; index += 1) yield* sweepAgain(fixture, reactor);
1325 assert.deepStrictEqual(yield* Ref.get(fixture.summaryCalls), []);
1326
apps/server/src/orchestration-v2/PullRequestSyncReactor.ts
+3
@@ -749,6 +749,9 @@ export const make = Effect.gen(function* () {
749 ended.add(item.id);
750 return Effect.andThen(linked, refreshUnmergedLinks(event.threadId));
751 }
752 + // Settled threads are not swept, so read their links once to settle with fresh status.
753 + case "thread.settled":
754 + return refreshUnmergedLinks(event.threadId);
755 case "run.updated":
756 return isTerminalRunStatus(event.payload.status) && closeCommands.delete(event.threadId)
757 ? refreshUnmergedLinks(event.threadId)
docs/user/source-control.md
+1 -1
@@ -320,7 +320,7 @@ Linking and unlinking are available in the web and desktop clients.
320 The **Linked pull requests** panel lists every review and groups stacks. Unlink a review from its
321 row menu. An unlinked stack layer stays out of later syncs. Open linked reviews refresh on the server;
322 closed reviews refresh periodically so reopening one on the host is detected. Merged reviews refresh
323 -when requested. A settled thread's reviews stop refreshing until you unsettle it. With **Auto-settle merged threads** enabled, a thread can settle after every linked
323 +when requested. Settling a thread refreshes its open and closed reviews once; after that they stop refreshing until you unsettle it. With **Auto-settle merged threads** enabled, a thread can settle after every linked
324 review is terminal. An open or unsynced link keeps it active.
325
326 Ask the agent to watch, monitor, or babysit a pull request and it calls `watch_pull_request`. While