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

Đang mở Phù hợp với người mới
#4,046 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Raj1v đang làm issue này rồi.

Từ ngày 25/11/2026.

  • #4048 của @Raj1v — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
authorization

Hướng nghiên cứu

Bắt đầu từ packages/core/inbox-permission.ts, tại inboxPermissionDecisionFor, nơi mọi allow đều trả lại đầu vào của công cụ dưới dạng updatedInput. Cách sửa là bỏ trường đó khỏi quyết định allow, đồng thời giữ nguyên đường đi ExitPlanMode vì nó thực sự cần trường này. Trước tiên, hãy đọc và chạy các test hiện có xung quanh module này. Sau đó xác nhận bằng một hook PermissionRequest giả luôn cho phép, kiểm tra rằng quyết định vẫn đến được Claude Code. Hoàn thành khi một allow không có updatedInput được chấp nhận cho Bash, Write và một cập nhật setMode, và không có test nào mong đợi đầu vào được trả lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
649
Merge trung bình
14 giờ 26 phút
Pull request đã merge (30 ngày)
772

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của backnotprop/plannotator

Tất cả issue của backnotprop/plannotator

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.