Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): settle Claude background agents when their process exits #19464

MergedExotic209093(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/19464/headmerged by juliusmarminge View on GitHub

Showing 4 changed files with 75 additions and 49 deletions (loading 2).

x
0 of 4 viewed, 4 left
71 additions and 46 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -8839,59 +8839,84 @@
- it.effect("ends a subagent's open call when the CLI exits while the root turn is idle", () =>
- Effect.scoped(
- Effect.gen(function* () {
- const TOOL_USE_ID = "toolu-idle-exit";
- const BASH = "toolu-idle-exit-bash";
- const harness = yield* makeWakeHarness;
- const now = yield* DateTime.now;
- const bashStatuses = () =>
- harness.events.flatMap((event) =>
- event.type === "turn_item.updated" && event.turnItem.nativeItemRef?.nativeId === BASH
- ? [`${event.turnItem.type}:${event.turnItem.status}`]
- : [],
+ it.effect.each(["exit", "Stop"] as const)(
+ "settles a plain background subagent and its open call on %s after the root turn completes",
+ (reason) =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const TOOL_USE_ID = "toolu-idle-exit";
+ const BASH = "toolu-idle-exit-bash";
+ const harness = yield* makeWakeHarnessWithOptions({ close: Queue.shutdown });
+ const now = yield* DateTime.now;
+ const bashStatuses = () =>
+ harness.events.flatMap((event) =>
+ event.type === "turn_item.updated" && event.turnItem.nativeItemRef?.nativeId === BASH
+ ? [`${event.turnItem.type}:${event.turnItem.status}`]
+ : [],