Skip to content

Commit 7f005d4

Browse files
only21milclaude
andauthored
fix(server): forks no longer inherit pending title regeneration (#24014)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent f0ec739 commit 7f005d4

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/ThreadForkService.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { assert, it } from "@effect/vitest";
22
import {
3+
CommandId,
34
ContextTransferId,
45
MessageId,
56
type ModelSelection,
@@ -159,6 +160,24 @@ it.effect("keeps a fork awake when its source thread is snoozed", () =>
159160
}),
160161
);
161162

163+
it.effect("starts a fork without the source thread's pending title regeneration", () =>
164+
Effect.gen(function* () {
165+
const sourceRun = makeSourceRun("completed");
166+
const titleRegeneration = {
167+
requestId: CommandId.make("command:fork-source-title"),
168+
startedAt: snoozedAt,
169+
};
170+
const sourceProjection = {
171+
...makeSourceProjection(sourceRun),
172+
thread: { ...makeSourceThread(), titleRegeneration },
173+
};
174+
const result = yield* planFork(sourceRun, sourceProjection);
175+
176+
assert.isNull(result.targetThread.titleRegeneration);
177+
assert.deepEqual(sourceProjection.thread.titleRegeneration, titleRegeneration);
178+
}),
179+
);
180+
162181
it.effect("preserves pull request context without inheriting any watches", () =>
163182
Effect.gen(function* () {
164183
const sourceRun = makeSourceRun("completed");

‎apps/server/src/orchestration-v2/ThreadForkService.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ export const layer: Layer.Layer<ThreadForkServiceV2> = Layer.succeed(
9090
creationSource: input.creationSource,
9191
id: input.targetThreadId,
9292
title: input.title ?? `${input.sourceProjection.thread.title} fork`,
93+
// The source's title job completes only on the source thread.
94+
titleRegeneration: null,
9395
activeProviderThreadId: null,
9496
lineage: {
9597
parentThreadId: input.sourceProjection.thread.id,

0 commit comments

Comments
 (0)