fix: forward clarify events from bridge to Web Chat UI#1023
Open
Macgrady4Ever wants to merge 2 commits into
Open
fix: forward clarify events from bridge to Web Chat UI#1023Macgrady4Ever wants to merge 2 commits into
Macgrady4Ever wants to merge 2 commits into
Conversation
The clarify() tool calls were correctly emitted by the Python bridge as 'clarify.requested' events, and the frontend had full support for rendering the clarify bar and handling user responses. However, the middle layer in handle-bridge-run.ts (applyBridgeChunkAsync) was missing the event-handling branches for clarify.requested and clarify.resolved, causing them to be silently dropped in the for loop. This caused the Web Chat clarify bar to never render, resulting in a 5-minute timeout and a broken interaction flow. Fix: add 'clarify.requested' and 'clarify.resolved' branches following the same pattern as the existing 'approval.requested'/'approval.resolved' handlers — constructing payloads and emitting them via Socket.IO so the frontend store receives them and ChatPanel.vue renders the clarify bar.
…for clarify events - Use replaceState instead of pushState (consistent with approval pattern) - Add Array.isArray guard on choices (defensive, from main)
Author
|
@EKKOLearnAI 您好, 这个确实很影响体验, 会卡很久webchat界面.请作者大大看一眼. |
Owner
|
我最新合并的mian分支还有这种情况吗? |
Author
嗯, 我刚才回到家, 用家里电脑用v0.6.1的代码刚升级的, 发现一旦clarify还是有这个卡住的问题 |
Owner
|
可以试下最新的main分支 空白/plan就会触发 |
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
Web Chat UI fails to render clarify() popups because the bridge agent does not forward
clarify.requestedandclarify.resolvedevents to the Web Chat frontend.Bug
When the AI agent calls
clarify()with a question and choices, the event is received by the bridge but silently dropped — the Web Chat frontend never gets notified. The user sees no popup, and the conversation stalls until the 5-minute clarify timeout expires.Root Cause
handle-bridge-run.tsonly forwardsapproval.requested/approval.resolvedevents. Clarify events have the same bridge→UI forwarding requirement but were missing.Fix
Added two event branches in
applyBridgeChunkAsync(), mirroring the approval pattern:clarify.requested— forwards question, choices, clarify_id, timeout_ms to the UIclarify.resolved— forwards clarify_id resolution to the UIBoth use
pushState()+emit(), consistent with the existing approval handler.Changed Files
packages/server/src/services/hermes/run-chat/handle-bridge-run.ts(+19 lines)Test Plan