Deliver ask_user to both editor and SSE clients concurrently#494
Merged
ericdallo merged 2 commits intoJun 7, 2026
Merged
Conversation
BroadcastMessenger.ask-question gated on SSE presence: if any SSE/web client was connected, the question went only to SSE and inner (the JSON-RPC editor) was never asked. With both connected, the editor's ask_user tool call would render but the chat/askQuestion request never arrived, leaving the chat silently blocked. Now ask both transports and let the first answer win. The unified promise is registered for the SSE /api/v1/answer path; a watcher future bridges the editor's answer via an idempotent deliver, and answer-question! cancels that watcher when SSE wins so it never parks forever on an editor that may not respond. Adds dual-dispatch tests (question reaches both, SSE-answer-wins incl. watcher cancellation, editor-answer-wins) and updates the SSE-isolation tests to model the editor not answering yet.
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.
This PR builds on #493 to change the behavior of eca such that it will now broadcast to both the editor and SSE clients. This is useful so that if you happen to have an eca client open (browser UI, iOS client, etc) you don't make it so your editor is incapable of responding to
ask_user.Clients should be updated to handle closing the ask_user dialog when they see a
toolCalledortoolCallRejectednotification with the sametoolCallId(and assumed it was handled by a different client). This is already consistent with what clients are expected to do with other tool calls.