From f654c3c3ff349b689f91e89dbb4e499697c7d445 Mon Sep 17 00:00:00 2001 From: Hikari Date: Fri, 6 Feb 2026 20:50:23 -0800 Subject: [PATCH] fix: resolve permission modal issues with successful operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #113 - EnterPlanMode/ExitPlanMode infinite permission loops This commit addresses multiple related issues with the permission system: 1. Added system tool filtering to sibling tools loop to prevent EnterPlanMode/ExitPlanMode from appearing in permission modals 2. Skip permission modal processing entirely when operations succeed (subtype == "success"), since tools were already approved and executed 3. Emit proper state change before early return to prevent Hikari from getting stuck in "typing" state The early return happens after all stats, costs, and achievements are processed, so no data tracking is affected. ✨ This issue was fixed with help from Hikari~ 🌸 --- src-tauri/src/wsl_bridge.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index 3056305..860583e 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -1218,6 +1218,12 @@ fn process_json_line( if let Some(denials) = permission_denials { // Only process if there are actually denials if !denials.is_empty() { + // Skip permission prompts if the result was successful - tools were already approved + if subtype == "success" { + emit_state_change(app, state, None, conversation_id.clone()); + return Ok(()); + } + let mut regular_permission_requests = Vec::new(); // Get denied tool IDs for later comparison @@ -1310,6 +1316,10 @@ fn process_json_line( // Check for sibling tools that may have been cancelled // Add them to the permission batch so they can be approved together for tool_use in captured_pending_tools.iter() { + // Skip system tools that should never require permission + if is_system_tool(&tool_use.tool_name) { + continue; + } // Only add tools that weren't explicitly denied (these are likely cancelled siblings) if !denied_tool_ids.contains(&tool_use.tool_use_id) { let description = format_tool_description(&tool_use.tool_name, &tool_use.tool_input);