Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): emit terminal task rows for subagents that survive a stop sweep #7585

Closedspiky02plateau(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7585/headopened View on GitHub

Showing 2 changed files with 228 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
228 additions and 0 deletionsapps/server/src/provider/Layers/ClaudeAdapter.test.tsModified
View file
@@ -56,6 +56,8 @@
​
public readonly interruptCalls: Array<void> = [];
public readonly stopTaskCalls: Array<string> = [];
+ /** Task ids whose stopTask should reject, modelling a child that refuses. */
+ public readonly stopTaskRejections = new Set<string>();
public readonly setModelCalls: Array<string | undefined> = [];
public readonly setPermissionModeCalls: Array<string> = [];
public readonly setMaxThinkingTokensCalls: Array<number | null> = [];
@@ -101,6 +103,9 @@
​
readonly stopTask = async (taskId: string): Promise<void> => {
this.stopTaskCalls.push(taskId);
+ if (this.stopTaskRejections.has(taskId)) {
+ throw new Error(`stopTask refused for ${taskId}`);
+ }
​
readonly setModel = async (model?: string): Promise<void> => {
@@ -1665,6 +1670,229 @@
+ it.effect("interruptTurn settles a task whose stopTask was refused", () => {
+ const harness = makeHarness();
+ return Effect.gen(function* () {
+ const adapter = yield* ClaudeAdapter;
+​