Repository navigation
fix(worker): Claude 权限确认框提醒不再误报引用文本、不再与权限卡片重复 - #3027
Merged
Merged
Conversation
回复正文原样引用「问句 / 1. 2. / Esc to cancel」时,屏幕探测会误判为权限确认框并 发文字提醒;未开 bypass 的会话里,PermissionRequest hook 已发了可点的允许/拒绝 卡片,屏幕探测又发一条「去终端选择」文字,一屏两条。 - 通知路径要求页脚是屏幕最后一个非空行:真实确认框会顶掉输入框,页脚下方 还有正文、围栏或输入框就是引用。保活门禁仍接受任意位置的页脚,保持失败即拒绝。 - 该提醒带上 kind,daemon 在本会话已有待决权限卡片时不再发文字。屏幕每 2 秒 采样一次,提醒可能先于卡片登记到达,没有卡片时等 3 秒再查一次。 hook 未装、fork 子代理等没有卡片的场景照常发文字。 Fixes #1685
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
November 7, 2026 11:07
This was referenced Nov 7, 2026
Owner
Author
|
已合入 master(d805fe34)。评审中记录的两个边界问题已开 follow-up issue 跟踪:
两项均不阻断本次合入,现有行为(保活门禁 fail-closed、hook 未装与 fork 场景文字兜底)不受影响。 |
This was referenced Nov 8, 2026
|
🚀 Released in v3.59.0 |
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.
Fixes #1685
症状
Do you want to ...?/1.2./Esc to cancel」,屏幕探测会当成权限确认框,往飞书发一条「去终端选择」的文字提醒(页脚后还有正文、代码围栏、底部仍是输入框都会命中)。根因
claudeActionPrompt只要求问句下方「某处」有页脚,不管页脚下面还有没有内容。真实确认框会顶掉输入框,页脚恒为屏幕最后一行;引用文本下面总还有东西。修法
claudeActionPrompt要求页脚之下没有非空行(边框字符已按原逻辑洗成空行)。prompt-cache 保活门禁传footerAnywhere: true保持原判定:门禁是失败即拒绝的安全门,不能因为这次收紧在「确认框下方仍画着输入框」的屏幕上放行保活回车。user_notify带上kind: 'claude_permission_prompt'。daemon 收到时,若本会话已有待决的 PermissionRequest 卡片(hook 来源、单问、选项为 allow/deny 的 ask)就不发文字。屏幕每 2 秒采样一次,hook 的卡片在框渲染前后登记,提醒可能先到,所以没有卡片时等 3 秒再查一次(该 handler 是并发的,不阻塞其他消息)。hook 未装、fork 子代理(hook 不接管)等没有卡片的场景照常发文字兜底。session.requires_attention生命周期 hook 不变。启动信任框家族、测试补牙和其余 P3 不在本次范围。
验证
footerAnywhere、空行也算页脚下方内容、daemon 换回 master、去掉 3 秒复查、任意 ask 都算权限卡片、不区分会话。claude-action-prompt/prompt-cache-keepalive-gate/prompt-cache-keepalive/stuck-warning-integration/session-lifecycle-hooks/stuck-page-card共 182 例通过;bun run build(含 tsc)通过。