diff --git a/assistant/src/runtime/run-orchestrator.ts b/assistant/src/runtime/run-orchestrator.ts index 5f07d5107cd..7244c42cd48 100644 --- a/assistant/src/runtime/run-orchestrator.ts +++ b/assistant/src/runtime/run-orchestrator.ts @@ -87,8 +87,8 @@ export class RunOrchestrator { // Hook into session to intercept confirmation_request events. // When the prompter sends a confirmation_request, we record it in the // run store so the web UI can poll and submit a decision. - // Pass hasNoClient=true so interactive-only prompts (e.g. host - // attachment reads) fail fast instead of waiting for a timeout. + // Do NOT set hasNoClient — run sessions have a client (the HTTP caller) + // and confirmations are handled via the /runs/:id/decision endpoint. let lastError: string | null = null; session.updateClient((msg: ServerMessage) => { if (msg.type === 'confirmation_request') { @@ -106,13 +106,15 @@ export class RunOrchestrator { session, }); } - }, true); + }); // Fire-and-forget the agent loop const cleanup = () => { this.pending.delete(run.id); // Reset the session's client callback to a no-op so the stale // closure doesn't intercept events from future runs on the same session. + // Set hasNoClient=true here since the run is done and no HTTP caller + // is actively listening — truly no client at this point. session.updateClient(() => {}, true); };