From 0885476709ffbe1682c44cef0be4aa7bcec5a3d6 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Tue, 10 Nov 2026 04:57:34 -0500 Subject: [PATCH] fix(orchestration): a start answered after its Run was reset says so --- .../federation/remote-owned/remote-owned-start.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/runtime/orchestration/federation/remote-owned/remote-owned-start.ts b/src/main/runtime/orchestration/federation/remote-owned/remote-owned-start.ts index e62b48baf5d..78188deedf7 100644 --- a/src/main/runtime/orchestration/federation/remote-owned/remote-owned-start.ts +++ b/src/main/runtime/orchestration/federation/remote-owned/remote-owned-start.ts @@ -147,7 +147,7 @@ export async function startRemoteOwnedWorker( } const started = StartedOnServer.safeParse(receipt) if (started.success) { - recordRemoteStart(db, { + const recorded = recordRemoteStart(db, { conversationId: link.conversation_id, taskId, dispatchId: started.data.dispatchId, @@ -155,6 +155,13 @@ export async function startRemoteOwnedWorker( peerRunId: started.data.run?.id, agent: started.data.agent ?? null }) + if (!recorded) { + throw new OrchestrationError( + 'run_not_found', + `Run ${run.id} was reset, or its pairing with ${server.name} re-made, while this start was waiting, so this Orca records nothing for the worker it started there (Dispatch ${started.data.dispatchId}).`, + { server: server.name } + ) + } prepareWorkerStartCard( runtime, ctx.orchestrationCaller