Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): running task results tell the agent to end its turn #24782

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/24782/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 146 additions and 3 deletions.

x
0 of 3 viewed, 3 left
109 additions and 0 deletionsapps/server/src/mcp/OrchestratorMcpService.test.tsModified
View file
@@ -5,6 +5,7 @@
EnvironmentId,
MessageId,
NodeId,
+ ORCHESTRATOR_MCP_RUNNING_TASK_NEXT,
type OrchestratorMcpCapabilitiesResult,
OrchestratorMcpTarget,
type OrchestrationV2ThreadShell,
@@ -292,6 +293,114 @@
}),
​
+ it.effect("tells the parent to end its turn only while its task still runs", () =>
+ Effect.gen(function* () {
+ const parentThreadId = ThreadId.make("thread:mcp-next-parent");
+ const childThreadId = ThreadId.make("thread:mcp-next-child");
+ const taskId = NodeId.make("node:mcp-next-task");
+ let finished = false;
+ let pendingRequest = false;
+ const parentProjection = () =>
+ ({
+ thread: { id: parentThreadId },
+ runs: [],
+ contextTransfers: [],
+ subagents: [
+ {
+ id: taskId,
+ threadId: parentThreadId,
+ origin: "app_owned",