Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions apps/server/src/orchestration-v2/SubagentProjection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,32 @@ it("waits for nested work and retains the report across monitor acknowledgements
});
assert.equal(progress.state, "result_available");
assert.equal(progress.resultRun?.id, report.id);
const ended = { ...report, id: RunId.make("monitor-ended"), ordinal: 4 };
const afterMonitorEnded = delegatedTaskProgress({
...projection,
runs: [run, report, monitor, ended],
messages: [
{
...artifacts.message,
runId: monitor.id,
notification: {
source: { kind: "monitor" },
outcome: "updated",
summary: "Monitor update",
},
},
{
...artifacts.message,
runId: ended.id,
notification: {
source: { kind: "monitor" },
outcome: "completed",
summary: 'Monitor "ticks" finished',
},
},
],
});
assert.equal(afterMonitorEnded.resultRun?.id, ended.id);
});

it("exposes the provider failure rather than a progress message from the failed run", () => {
Expand Down
6 changes: 5 additions & 1 deletion packages/provider-core/src/server/subagentProjection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,11 @@ export function delegatedTaskProgress(projection: {
["completed", "failed", "cancelled", "interrupted", "rolled_back"].includes(status);
const monitorRuns = new Set(
projection.messages
.filter((message) => message.notification?.source.kind === "monitor")
.filter(
(message) =>
message.notification?.source.kind === "monitor" &&
message.notification.outcome === "updated",
)
.map((message) => message.runId),
);
const workRuns = projection.runs.filter(
Expand Down
Loading