fix(runs): allow host attachment confirmation for run sessions#2330
Merged
Conversation
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 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Run sessions created via the HTTP API DO have a client (the HTTP caller), they just don't have a WebSocket/IPC client. The
hasNoClientflag was incorrectly set totruefor run sessions, causingapproveHostAttachmentReadto deny immediately — host attachment directives could never enterneeds_confirmationstate and were always skipped.The fix: Remove
hasNoClient=truefrom theupdateClientcall during active run processing inRunOrchestrator.startRun(). The run orchestrator already interceptsconfirmation_requestevents and stores them viarunsStore.setRunConfirmation, so the/runs/:id/decisionendpoint can handle approvals. ThehasNoClient=trueflag is still set in the cleanup callback after the run completes, since there truly is no client at that point.Changes
assistant/src/runtime/run-orchestrator.ts: RemovehasNoClient=truefromupdateClient()during active run, keeping it only in the post-run cleanup.Addresses feedback from PR #2306.