fix native run authority type narrowing

This commit is contained in:
Merge Sim
2026-09-08 15:54:06 -07:00
parent b79c81c327
commit e724beab8e
@@ -47,8 +47,12 @@ export const ORCHESTRATION_RUN_METHODS: RpcMethod[] = [
})
return { run: exposeRun(run) }
}
const coordinatorHandle = params.from
if (!coordinatorHandle) {
throw new OrchestrationError('stable_pane_required', 'Missing coordinator identity.')
}
const paneKey = resolveOrchestrationCaller(runtime, {
callerTerminalHandle: params.from,
callerTerminalHandle: coordinatorHandle,
callerEvidence: orchestrationCompatibilityEvidence,
requireStablePane: true
})
@@ -56,10 +60,10 @@ export const ORCHESTRATION_RUN_METHODS: RpcMethod[] = [
const priorRun = db.getCurrentRunForPane(paneKey)
const run = db.createRun({
objective: params.objective,
coordinatorHandle: params.from,
coordinatorHandle,
coordinatorPaneKey: paneKey
})
runtime.cancelMessageWaiters(params.from)
runtime.cancelMessageWaiters(coordinatorHandle)
if (priorRun) {
runtime.cancelMessageWaiters(`run:${priorRun.id}`)
}