Orphaned permission.requested event replays on every session resume, causing repeated directory-access prompts that can't be dismissed
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
Describe the bug
Summary:
A long-lived, repeatedly-resumed CLI session is showing a recurring "Allow directory access" prompt at startup, every time, for over a week. The prompt references a path ( ../Zscaler-....zip ) from a bash command that was run and completed 10 days prior. Approving the prompt has no effect — it reappears on the next resume.
Root cause (found via session logs/events.jsonl):
• On 2026-08-02, a permission.requested event was logged for a shell command ( unzip ../Zscaler-....zip ) in session 5ee3e3d6-afd7-4534-b4a9-ad665f1d8e5e .
• The associated tool call completed successfully ( tool.execution_complete , success), but no corresponding permission.completed event was ever written for that requestId .
• On every subsequent resume of this same session, the runtime appears to replay/re-surface this orphaned, still-"pending" permission request to the user.
• When the user answers, the log shows: Ignoring permission response for already-resolved tool call '' (request '') — confirming the runtime treats the underlying tool call as already resolved, but never clears the dangling permission-request state, so it keeps re-prompting on a loop that can never be satisfied.
Impact: Users on long-lived resumed sessions get a spurious, unresolvable permission prompt on every startup indefinitely, referencing stale/irrelevant paths from old completed commands, with no way to dismiss it via the answer options offered.
Suggested fix: On session resume, either (a) skip replaying permission.requested events whose tool call has already reached a terminal state (success/failure), or (b) write a permission.completed event immediately once a tool call completes, regardless of whether the permission response was captured in time.
Workaround used: Starting a new session instead of resuming the affected one.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với events.jsonl của session bị ảnh hưởng và theo dõi cách các sự kiện permission.requested được phát lại trong quá trình tiếp tục session. So sánh request mồ côi với sự kiện tool.execution_complete đã hoàn tất và sự kiện permission.completed bị thiếu. Được xem là hoàn tất khi một lần gọi tool đã hoàn tất không còn khiến prompt cấp quyền cũ xuất hiện lại trong những lần tiếp tục session sau đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100