fix(web): 权限弹窗点拒绝后新请求被误删,弹窗失踪、后端空等 5 分钟 - #15
Open
shaohaozhi286 wants to merge 1 commit into
Open
Conversation
根因:PermissionModal 的 respond 里 setTimeout(220ms) 与 Modal close 动画 (200ms 后 onClose → handleModalClose)双重触发 onResolve,而 App 层 onResolve 盲删 permReqs 队首 —— 一次点击删两条。agent_loop Phase 2 串行执行同批次写 工具,deny 解除阻塞后毫秒级发出下一条 permission_request,恰好落进窗口被 第二刀误删:弹窗永不出现,AsyncPrompter 空等 5 分钟超时,排队消息全部堵死。 修复: - 新增 lib/permissionRequestQueue.js 纯函数(push 按 request_id 去重 / remove 按 request_id 幂等移除),App.jsx 改用之,不再盲删队首 - respond 删掉多余的 setTimeout,onResolve(request_id) 统一走 Modal onClose 单一路径 - PermissionModal 按 request_id 加 key 强制重挂载:队首 A→B 切换若复用 实例,Modal 内部 show=false 的透明遮罩会挡住整页且新弹窗不可见 验证:node 单测(含回归场景) + vite build + 真实 daemon 端到端(deepseek 一次回复发两个 file_write,拒绝第一个后第二个弹窗正常顶上,transcript 四个工具调用全部得到决策,无 5 分钟空等)。 Co-Authored-By: Claude Fable 5 <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.
@-