Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a resumed Claude subagent's thread shows the message that resumed it #13668

Mergedjuliusmarmingemerged 1 commit intot3code/codex-turn-mapping fromrefs/pull/13668/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 49 additions and 4 deletions.

x
0 of 2 viewed, 2 left
28 additions and 3 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.tsModified
View file
@@ -2459,6 +2459,9 @@
readonly childRootNodeId: OrchestrationV2ExecutionNode["id"];
readonly turnItemId: OrchestrationV2TurnItem["id"];
readonly turnItemOrdinal: number;
+ // The tool call that started the current run: the Agent launch, then each
+ // SendMessage that resumes the subagent. A new one means a new prompt.
+ readonly runToolUseId: string | null;
nextChildItemOrdinal: number;
progressItemOrdinal: number | null;
progressStartedAt: DateTime.Utc | null;
@@ -3431,6 +3434,17 @@
return;
+ // A task_started under a tool call other than the current run's is
+ // a resume: SendMessage re-emits task_started for the same task id
+ // under its own tool_use_id, with the sent message as the prompt.
+ const resumeToolUseId =
+ input.reopen === true &&
+ existingSubagent !== undefined &&
+ input.toolUseId !== undefined &&
+ input.toolUseId !== existingSubagent.runToolUseId &&
+ input.prompt !== undefined
+ ? input.toolUseId
+ : null;
const lifecycleChanged =
existingSubagent === undefined ||
existingSubagent.task.status !== input.status ||