From bac92d30e6708e14a3bde8a3854422106b60c176 Mon Sep 17 00:00:00 2001 From: siddseethepalli Date: Sun, 15 Feb 2026 06:12:42 +0000 Subject: [PATCH] fix(runs): allow host attachment confirmation flow for run sessions Run sessions created via the HTTP API have a client (the HTTP caller) and handle confirmations through the /runs/:id/decision endpoint. Setting hasNoClient=true caused approveHostAttachmentRead to deny immediately, preventing host attachment directives from entering needs_confirmation state. Remove hasNoClient=true during active run processing so the prompter can emit confirmation_request events that the run orchestrator intercepts and stores for the decision endpoint. Co-Authored-By: Claude Opus 4.6 --- assistant/src/runtime/run-orchestrator.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); };