fix: deny of one tool call permanently blocks all future same-tool calls#1388
fix: deny of one tool call permanently blocks all future same-tool calls#1388Oliver-ZPLiu wants to merge 1 commit into
Conversation
…lls (Hmbown#1377) When a user denies a tool call (e.g. edit_file), the tool_name was inserted into approval_session_denied alongside the per-call approval_key. Every subsequent invocation of the same tool type was then auto-denied for the rest of the session without prompting. Fix: only store the approval_key (per-call unique). This still prevents the model's retry loop from re-prompting the exact same command (Hmbown#360), but allows the user to approve a fresh invocation of the same tool type.
There was a problem hiding this comment.
Code Review
This pull request updates the tool denial logic in crates/tui/src/tui/ui.rs to ensure that only the unique approval_key is cached when a user denies or aborts a tool call. Previously, the code also cached the tool_name, which incorrectly blocked all future invocations of that tool type. I have no feedback to provide as there were no review comments to evaluate.
|
Cherry-picked into CHANGELOG entry for v0.8.28:
This will auto-close when v0.8.28 lands on |
|
v0.8.28 is live — your work shipped:
Closing this PR. Thanks again! |
Summary
Fixes #1377 — denying a tool call (e.g.
edit_file) once permanently auto-denies every subsequent invocation of the same tool type for the rest of the session.Root cause
In
handle_view_events, when a tool call is denied, both thetool_name(e.g."edit_file") and theapproval_key(per-call unique) were inserted intoapp.approval_session_denied. Thetool_nameentry caused all future calls toedit_fileto be auto-denied without prompting.Fix
Only store the
approval_keyon denial. Theapproval_keyis per-call unique, which still prevents the model's retry loop from re-prompting the exact same command (#360), but allows fresh invocations of the same tool type to prompt the user for approval.Files changed
crates/tui/src/tui/ui.rstool_nameinsertion intoapproval_session_deniedTest plan
cargo check -p deepseek-tuipassescargo clippy -p deepseek-tui --all-targets --all-features --locked -- -D warningspassesApprovedForSession) is unchanged