fix(permission): make session/persist approval grants tool-wide#3542
Merged
Conversation
"Allow for this session" and "Allow persistently" pinned the exact subject (file path / command), so writing a different file or running a different command re-prompted every time — users read the labels as "trust this tool" and reasonably expected no further prompts. Both now grant the whole tool: the session grant keys on the tool name, and the persisted rule is the bare tool name. Deny rules still take precedence on every call. Adds a full agent-turn e2e proving a second file write under the same tool runs without a second prompt. Closes #3498 Closes #3520
This was referenced Jun 10, 2026
Closed
dorokuma
pushed a commit
to dorokuma/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
…gine#3542) * fix(permission): make session/persist approval grants tool-wide "Allow for this session" and "Allow persistently" pinned the exact subject (file path / command), so writing a different file or running a different command re-prompted every time — users read the labels as "trust this tool" and reasonably expected no further prompts. Both now grant the whole tool: the session grant keys on the tool name, and the persisted rule is the bare tool name. Deny rules still take precedence on every call. Adds a full agent-turn e2e proving a second file write under the same tool runs without a second prompt. Closes esengine#3498 Closes esengine#3520 * test: gofmt the e2e approval test --------- Co-authored-by: reasonix <reasonix@deepseek.com>
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 the most-reported approval complaint: clicking "本会话内允许" / "持久允许" (allow for session / allow persistently) kept re-prompting on every new file or command.
Root cause
Both grants pinned the exact subject (file path / command):
tool + subject(requestApproval),tool=subject(literal).So "allow write_file for this session" only suppressed re-prompts for that one file; the next file re-asked. Users read the labels as "trust this tool" and expected no further prompts.
Fix (tool-wide, per maintainer decision)
rm -rfon the deny list is still blocked even after "allow bash for this session".Tests
TestApprovalSessionGrantto use different subjects (the actual regression).TestApprovalToolWideEndToEnd): model writes two different files, user picks "allow for session" once, second write runs with no second prompt — exactly one approval, both files written.Closes #3498
Closes #3520