GeezerVison is showing github.com — fix(server): a waiting child run marks its parent task waiting (#38112) · pingdotgg/t3code@25fada9
File tree
Expand file treeCollapse file tree
Open diff view settings
apps/server/src/orchestration-v2
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts +21Lines changed: 21 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2432,6 +2432,27 @@ it.layer(Layer.merge(layerTest, ProviderContinuationRequests.layer))( |
2432 | 2432 | const resumed = yield* orchestrator.getThreadProjection(parentThreadId); |
2433 | 2433 | assert.equal(resumed.subagents.find((row) => row.id === task.id)?.status, "running"); |
2434 | 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"); |
2435 | 2456 | }), |
2436 | 2457 | ); |
2437 | 2458 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Orchestrator.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -15824,7 +15824,8 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio |
15824 | 15824 | stored.event.payload.queueHeld === true)) && |
15825 | 15825 | ((stored.event.payload.delegatedTaskId !== undefined && |
15826 | 15826 | (stored.event.payload.status === "queued" || |
15827 | | - stored.event.payload.status === "starting")) || |
| 15827 | + stored.event.payload.status === "starting" || |
| 15828 | + stored.event.payload.status === "waiting")) || |
15828 | 15829 | stored.event.payload.status === "completed" || |
15829 | 15830 | stored.event.payload.status === "interrupted" || |
15830 | 15831 | stored.event.payload.status === "failed" || |
|