Inbox permission: an allow sent with `updatedInput` is ignored by Claude Code on its own safety checks

未关闭 适合新手
#4,046 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Raj1v 已经在做这个了。

开始于 2026年11月25日。

  • #4048 来自 @Raj1v —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
authorization

调研方向

从 packages/core/inbox-permission.ts 中的 inboxPermissionDecisionFor 开始,那里每个 allow 都会把工具输入原样作为 updatedInput 回传。修复方法是从 allow 决定中去掉该字段,同时保持确实需要它的 ExitPlanMode 路径不变。先阅读并运行该模块周围的现有测试。然后用一个始终放行的替身 PermissionRequest 钩子进行确认,检查决定仍能到达 Claude Code。完成的标准是:不带 updatedInput 的 allow 能被 Bash、Write 和 setMode 更新接受,并且没有任何测试期望回传的输入。

由索引模型根据 Issue 内容生成。

描述

What happens
A launched Claude Code session (auto mode) calls EnterWorktree with a worktree outside .claude/worktrees/. The Inbox shows the permission card, I pick "Allow once" within seconds, and the hook receives the decision. Claude Code still leaves its own permission dialog open in the terminal ("permission-root relocation … a model-supplied worktree outside .claude/worktrees/"). The agent stayed blocked for 31 minutes until I approved it in the terminal. The card looked answered the whole time.

Cause
inboxPermissionDecisionFor (packages/core/inbox-permission.ts) returns every allow with updatedInput: event.tool_input, i.e. the tool's own input echoed back. On Claude Code 2.1.332, an allow that carries updatedInput is ignored when Claude Code's own safety check asks for a human. Without updatedInput, the same allow goes through ("Allowed by PermissionRequest hook").

Repro (Claude Code 2.1.332, a stand-in PermissionRequest hook that always allows)

  • Allow with updatedInput: the dialog stays up, both when sent at once and after 25 s.
  • Allow without updatedInput: allowed, both when sent at once and after 25 s. The same holds for a setMode update, Bash and Write.

Fix
Leave out updatedInput on allows. The hook only ever echoed the event's own input, so nothing is lost. ExitPlanMode, which does need updatedInput, never reaches this hook.

#3854 fixed a different case: a question withdrawn between hook polls. Here the question was never withdrawn; the decision was delivered and then ignored.

主要语言
TypeScript
星标
8.7k
派生
649
平均合并
14 小时 26 分钟
30 天内合并 PR
772

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

backnotprop/plannotator 的其他 Issue

查看 backnotprop/plannotator 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。