The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 09:45 UTC
fix(server): a delegated task reports the answer its child gives after an awaited Monitor ends (#37901)
Julius Marminge committed
Nov 16, 2026 at 20:22 UTC
a5c28da6c8bf676e49bf285765fb5e51ae2c8c71
2 files changed
+31
-1
apps/server/src/orchestration-v2/SubagentProjection.test.ts
+26
@@ -365,6 +365,32 @@ it("waits for nested work and retains the report across monitor acknowledgements
365
});
366
assert.equal(progress.state, "result_available");
367
assert.equal(progress.resultRun?.id, report.id);
368
+ const ended = { ...report, id: RunId.make("monitor-ended"), ordinal: 4 };
369
+ const afterMonitorEnded = delegatedTaskProgress({
370
+ ...projection,
371
+ runs: [run, report, monitor, ended],
372
+ messages: [
373
+ {
374
+ ...artifacts.message,
375
+ runId: monitor.id,
376
+ notification: {
377
+ source: { kind: "monitor" },
378
+ outcome: "updated",
379
+ summary: "Monitor update",
380
+ },
381
+ },
382
+ {
383
+ ...artifacts.message,
384
+ runId: ended.id,
385
+ notification: {
386
+ source: { kind: "monitor" },
387
+ outcome: "completed",
388
+ summary: 'Monitor "ticks" finished',
389
+ },
390
+ },
391
+ ],
392
+ });
393
+ assert.equal(afterMonitorEnded.resultRun?.id, ended.id);
394
});
395
396
it("exposes the provider failure rather than a progress message from the failed run", () => {
packages/provider-core/src/server/subagentProjection.ts
+5
-1
@@ -301,7 +301,11 @@ export function delegatedTaskProgress(projection: {
301
["completed", "failed", "cancelled", "interrupted", "rolled_back"].includes(status);
302
const monitorRuns = new Set(
303
projection.messages
304
- .filter((message) => message.notification?.source.kind === "monitor")
304
+ .filter(
305
+ (message) =>
306
+ message.notification?.source.kind === "monitor" &&
307
+ message.notification.outcome === "updated",
308
+ )
309
.map((message) => message.runId),
310
);
311
const workRuns = projection.runs.filter(