Skip to content

Deliver ask_user to both editor and SSE clients concurrently#494

Merged
ericdallo merged 2 commits into
editor-code-assistant:masterfrom
rschmukler:rs/broadcast-ask-user
Jun 7, 2026
Merged

Deliver ask_user to both editor and SSE clients concurrently#494
ericdallo merged 2 commits into
editor-code-assistant:masterfrom
rschmukler:rs/broadcast-ask-user

Conversation

@rschmukler

@rschmukler rschmukler commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

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 toolCalled or toolCallRejected notification with the same toolCallId (and assumed it was handled by a different client). This is already consistent with what clients are expected to do with other tool calls.

  • This is not an AI slop.

rschmukler and others added 2 commits June 6, 2026 16:37
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.

@ericdallo ericdallo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch ,thanks

@ericdallo ericdallo merged commit 418a209 into editor-code-assistant:master Jun 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants