From b8330378e93c321c450fbbed6416c77913aa0115 Mon Sep 17 00:00:00 2001 From: Jeff Louisma Date: Tue, 7 Oct 2025 09:36:35 -0700 Subject: [PATCH] Fix: Persist agent permission mode selection across sessions Fixes #39392 When a user selects a permission mode (e.g., 'Bypass Permissions') in the Claude Code agent, the mode now automatically persists as the default. Previously, the mode would only change for the current session and revert to the previous default when creating a new thread or session. Changes: - Mode selection now always saves as default (unless modifier key is held) - Holding the secondary modifier key (Ctrl/Cmd) allows toggling/unsetting the default mode - Updated tooltip text to reflect the new behavior This ensures that user's permission mode preferences persist across sessions as expected. --- crates/agent_ui/src/acp/mode_selector.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/agent_ui/src/acp/mode_selector.rs b/crates/agent_ui/src/acp/mode_selector.rs index 410874126665b7..11022e82a3705f 100644 --- a/crates/agent_ui/src/acp/mode_selector.rs +++ b/crates/agent_ui/src/acp/mode_selector.rs @@ -118,9 +118,9 @@ impl ModeSelector { )) .child(div().map(|this| { if is_default { - this.child("to also unset as default") + this.child("to unset as default") } else { - this.child("to also set as default") + this.child("to toggle as default") } })), ) @@ -147,6 +147,12 @@ impl ModeSelector { this.fs.clone(), cx, ); + } else { + this.agent_server.set_default_mode( + Some(mode_id.clone()), + this.fs.clone(), + cx, + ); } this.set_mode(mode_id.clone(), cx);