TypeScript
fix(server): subagent threads no longer inherit a pending title job (#27990)
Dreightoef4c6581099f
diff --git a/apps/server/src/orchestration-v2/SubagentProjection.test.ts b/apps/server/src/orchestration-v2/SubagentProjection.test.tsindex c410d6682da..ed643c2ff1a 100644--- a/apps/server/src/orchestration-v2/SubagentProjection.test.ts+++ b/apps/server/src/orchestration-v2/SubagentProjection.test.ts@@ -1,5 +1,6 @@import { assert, it } from "@effect/vitest";import {+ CommandId,type ModelSelection,NodeId,RunId,@@ -82,7 +83,10 @@ function makeParentThread(): OrchestrationV2AppThread {}it("keeps a subagent child awake when its parent thread is snoozed", () => {- const parentThread = makeParentThread();+ const parentThread: OrchestrationV2AppThread = {+ ...makeParentThread(),+ titleRegeneration: { requestId: CommandId.make("command:parent-title"), startedAt: snoozedAt },+ };const childProviderThreadId = ProviderThreadId.make("provider-thread:subagent-awake-child");const parentNodeId = NodeId.make("node:subagent-parent");const childThread = makeSubagentChildThread({@@ -100,6 +104,7 @@ it("keeps a subagent child awake when its parent thread is snoozed", () => {assert.isNull(childThread.snoozedUntil);assert.isNull(childThread.snoozedAt);+ assert.isNull(childThread.titleRegeneration);assert.equal(childThread.projectId, parentThread.projectId);assert.equal(childThread.runtimeMode, parentThread.runtimeMode);assert.equal(childThread.interactionMode, parentThread.interactionMode);diff --git a/packages/provider-core/src/server/subagentProjection.ts b/packages/provider-core/src/server/subagentProjection.tsindex e18687414f9..7179398cf60 100644--- a/packages/provider-core/src/server/subagentProjection.ts+++ b/packages/provider-core/src/server/subagentProjection.ts@@ -60,6 +60,7 @@ export function makeSubagentChildThread(input: {creationSource: input.creationSource,id: input.childThreadId,title: input.title,+ titleRegeneration: null,linkedPullRequest: null,pullRequests: [],historyOrigin: undefined,