Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): reject waits on foreground subagent background work #25036

Openjuliusmarmingewants to merge 10 commits intomain fromrefs/pull/25036/headopened View on GitHub

Showing 2 changed files with 111 additions and 1 deletion.

x
0 of 2 viewed, 2 left
100 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -11371,6 +11371,106 @@
+ it.effect("does not mark tasks owned by a foreground subagent as awaited", () =>
+ Effect.scoped(
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarness;
+ const now = yield* DateTime.now;
+ const awaitBackgroundTasks = harness.runtime.awaitBackgroundTasks;
+ if (awaitBackgroundTasks === undefined) {
+ throw new Error("Claude adapter runtime must expose awaitBackgroundTasks.");
+ const subagentStarted = (input: {
+ readonly taskId: string;
+ readonly toolUseId: string;
+ readonly backgrounded: boolean;
+ readonly uuid: string;
+ }) =>
+ claudeSdkFrame({
+ type: "system",
+ subtype: "task_started",
+ task_id: input.taskId,
+ tool_use_id: input.toolUseId,
+ description: input.taskId,
+ subagent_type: "general-purpose",
+ is_backgrounded: input.backgrounded,
+ task_type: "local_agent",
+ prompt: "Run a shell in the background.",
+ uuid: input.uuid,