Skip to content

Commit 719752f

Browse files
fix(server): sends to a finished child with no sender thread notify its parent
An unscoped MCP session, such as `t3 thread send` from a shell, dispatches with no senderThreadId. The follow-up gate treated that like a send from an unrelated thread, so the child's new run was never tracked on its parent. Treat a missing sender like a user send; sends from a non-parent thread stay excluded. Fixes pingdotgg#33432
1 parent 9cd5a85 commit 719752f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8325,12 +8325,14 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
83258325
if (!startsAttempt) return;
83268326
const child = yield* projectionStore.getThread(command.threadId);
83278327
const parentThreadId = child.lineage.parentThreadId;
8328+
// A send with no sender thread comes from a client acting for the owner, like a user send.
83288329
if (
83298330
child.lineage.relationshipToParent !== "subagent" ||
83308331
parentThreadId === null ||
83318332
(command.notification === undefined &&
83328333
command.createdBy !== "user" &&
83338334
command.usageLimitContinuationOfRunId === undefined &&
8335+
command.senderThreadId !== undefined &&
83348336
command.senderThreadId !== parentThreadId)
83358337
)
83368338
return;

0 commit comments

Comments
 (0)