Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): agents can see a thread's pending background work #33858

Mergedfjooord(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/33858/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 71 additions and 3 deletions (loading 2).

x
0 of 5 viewed, 5 left
17 additions and 1 deletionapps/server/src/mcp/OrchestratorMcpService.activity.test.tsModified
View file
@@ -193,7 +193,19 @@
? Effect.die("A failed caller read must not reach the target")
: Effect.succeed(
threadId === parentThreadId
- ? (projection.thread as unknown as OrchestrationV2ThreadShell)
+ ? ({
+ ...projection.thread,
+ blockedOnThreadWait: true,
+ pendingBackgroundTasks: [
+ {
+ taskId: "task-subagent",
+ kind: "subagent",
+ parentTaskId: "task-parent",
+ providerInstanceId: parentInstanceId,
+ childThreadId,
+ },
+ ],
+ } as unknown as OrchestrationV2ThreadShell)
: null,
getProjectThreadRecords: (input) =>
@@ -225,6 +237,10 @@
expect(result.thread.status).toBe("running");
expect(result.thread.latestRunId).toBe(cancelledRunId);
expect(result.thread.activeRunId).toBe(activeRunId);
+ expect(result.thread.blockedOnThreadWait).toBe(true);
+ expect(result.thread.pendingBackgroundTasks).toEqual([
+ { taskId: "task-subagent", kind: "subagent", childThreadId },
+ ]);