Skip to content

Commit adfa4df

Browse files
refactor(server): drop non-null assertion in stale question wake check
AI-assisted; verified with the tests and tools listed above.
1 parent a633ba1 commit adfa4df

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1893,17 +1893,18 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
18931893
return false;
18941894
const source = notification.source;
18951895
const task = projection.subagents.find((candidate) => source.taskIds.includes(candidate.id));
1896+
const childThreadId = task?.childThreadId ?? null;
18961897
if (
18971898
task === undefined ||
1898-
task.childThreadId === null ||
1899+
childThreadId === null ||
18991900
["completed", "failed", "cancelled", "interrupted"].includes(task.status)
19001901
)
19011902
return true;
19021903
const child = yield* projectionStore
1903-
.getThreadRecords(task.childThreadId, ["runtimeRequests"])
1904+
.getThreadRecords(childThreadId, ["runtimeRequests"])
19041905
.pipe(
19051906
Effect.mapError(
1906-
(cause) => new OrchestratorProjectionError({ threadId: task.childThreadId!, cause }),
1907+
(cause) => new OrchestratorProjectionError({ threadId: childThreadId, cause }),
19071908
),
19081909
);
19091910
return !child.runtimeRequests.some(

0 commit comments

Comments
 (0)