The best way to control Claude Code, Codex and more from any computer or phone
fix(server): a waiting child run marks its parent task waiting (#38112)
Julius Marminge committed
Nov 17, 2026 at 04:54 UTC
25fada9351ce9f907ecbe8ca3a819e358646777d
2 files changed
+23
-1
apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts
+21
@@ -2432,6 +2432,27 @@ it.layer(Layer.merge(layerTest, ProviderContinuationRequests.layer))(
2432
const resumed = yield* orchestrator.getThreadProjection(parentThreadId);
2433
assert.equal(resumed.subagents.find((row) => row.id === task.id)?.status, "running");
2434
assert.isNull(resumed.subagents.find((row) => row.id === task.id)?.result);
2435
+
2436
+ const started = (yield* orchestrator.getThreadProjection(child.childThreadId)).runs.find(
2437
+ (run) => run.id === queued.id,
2438
+ )!;
2439
+ const waitingSequence = yield* eventSink.latestSequence();
2440
+ yield* eventSink.write({
2441
+ events: [
2442
+ {
2443
+ id: EventId.make("event:held-followup-waiting"),
2444
+ type: "run.updated",
2445
+ threadId: child.childThreadId,
2446
+ runId: started.id,
2447
+ occurredAt: now,
2448
+ payload: { ...started, status: "waiting" },
2449
+ },
2450
+ ],
2451
+ });
2452
+ yield* waitForStatus(waitingSequence, "waiting");
2453
+ const waiting = yield* orchestrator.getThreadProjection(parentThreadId);
2454
+ assert.equal(waiting.subagents.find((row) => row.id === task.id)?.status, "waiting");
2455
+ assert.equal(waiting.nodes.find((row) => row.id === task.id)?.status, "waiting");
2456
}),
2457
);
2458
apps/server/src/orchestration-v2/Orchestrator.ts
+2
-1
@@ -15824,7 +15824,8 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
15824
stored.event.payload.queueHeld === true)) &&
15825
((stored.event.payload.delegatedTaskId !== undefined &&
15826
(stored.event.payload.status === "queued" ||
15827
- stored.event.payload.status === "starting")) ||
15827
+ stored.event.payload.status === "starting" ||
15828
+ stored.event.payload.status === "waiting")) ||
15829
stored.event.payload.status === "completed" ||
15830
stored.event.payload.status === "interrupted" ||
15831
stored.event.payload.status === "failed" ||