Skip to content
This repository was archived by the owner on Apr 8, 2026. It is now read-only.

Commit ddae15d

Browse files
author
Jobdori
committed
fix(enforcer): defer to caller prompt flow when active mode is Prompt
The PermissionEnforcer was hard-denying tool calls that needed user approval because it passes no prompter to authorize(). When the active permission mode is Prompt, the enforcer now returns Allowed and defers to the CLI's interactive approval flow. Fixes: mock_parity_harness bash_permission_prompt_approved scenario
1 parent 8cc7d4c commit ddae15d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust/crates/runtime/src/permission_enforcer.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ impl PermissionEnforcer {
3232
/// Check whether a tool can be executed under the current permission policy.
3333
/// Auto-denies when prompting is required but no prompter is provided.
3434
pub fn check(&self, tool_name: &str, input: &str) -> EnforcementResult {
35+
// When the active mode is Prompt, defer to the caller's interactive
36+
// prompt flow rather than hard-denying (the enforcer has no prompter).
37+
if self.policy.active_mode() == PermissionMode::Prompt {
38+
return EnforcementResult::Allowed;
39+
}
40+
3541
let outcome = self.policy.authorize(tool_name, input, None);
3642

3743
match outcome {

0 commit comments

Comments
 (0)