Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a finished Claude background subagent no longer alerts before its parent wakes #36812

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

Showing 3 changed files with 82 additions and 30 deletions (loading 2).

x
0 of 3 viewed, 3 left
82 additions and 30 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -15264,6 +15264,7 @@
{ ending: "notification", cancelled: "after its result" },
{ ending: "tool result", cancelled: "after its result" },
{ ending: "tool result", cancelled: "while the subagent ran" },
+ { ending: "notification and tool result", cancelled: "while the subagent ran" },
] as const)(
"does not replay a subagent that finished inside a cancelled wake (ended by $ending, cancelled $cancelled)",
({ ending, cancelled }) =>
@@ -15328,36 +15329,41 @@
if (cancelled === "while the subagent ran") {
yield* harness.continuationRequests[0]!.onRunEndedWithoutStarting!();
- yield* harness.offerAndWait(
- ending === "notification"
- ? claudeSdkFrame({
- type: "system",
- subtype: "task_notification",
- task_id: SUBAGENT_TASK_ID,
- tool_use_id: SUBAGENT_TOOL_USE_ID,
- status: "completed",
- output_file: "/tmp/fg-agent.output",
- summary: "Inspected",
- uuid: "00000000-0000-4000-8000-000000000163",
- session_id: WAKE_NATIVE_SESSION,
- })
- : claudeSdkFrame({
- type: "user",
- uuid: "00000000-0000-4000-8000-000000000163",
- session_id: WAKE_NATIVE_SESSION,