Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): stop Claude subagents without stopping their owner #17826

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/17826/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 15 changed files with 144 additions and 0 deletions (loading 12).

x
0 of 15 viewed, 15 left
109 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -2106,6 +2106,7 @@
const makeWakeHarnessWithOptions = (options?: {
readonly close?: (sdkMessages: Queue.Queue<SDKMessage>) => Effect.Effect<void>;
readonly interrupt?: Effect.Effect<void>;
+ readonly stopTask?: (taskId: string) => Effect.Effect<void>;
readonly environment?: NodeJS.ProcessEnv;
// A CLI process opened after the first streams from its own queue, so the
// first one can exit (Queue.shutdown) and a later turn can start another.
@@ -2130,6 +2131,10 @@
const permissionModeChanges: Array<string> = [];
const continuationRequests: Array<ProviderContinuationRequests.ProviderContinuationRequest> =
+ const subagentReceipts =
+ yield* Queue.unbounded<
+ Extract<ProviderAdapter.ProviderAdapterV2Event, { type: "subagent.updated" }>
+ >();
const terminalReceipts =
yield* Queue.unbounded<
Extract<ProviderAdapter.ProviderAdapterV2Event, { type: "turn.terminal" }>
@@ -2202,6 +2207,7 @@
Effect.sync(() => {
permissionModeChanges.push(mode);
+ ...(options?.stopTask === undefined ? {} : { stopTask: options.stopTask }),
interrupt: options?.interrupt ?? Effect.void,
close: options?.close?.(sdkMessages) ?? Effect.void,