From 2ccf048c8984d61e3341a4304d0796a1f965d3e7 Mon Sep 17 00:00:00 2001 From: Ben Gao Date: Mon, 25 May 2026 08:37:19 +0800 Subject: [PATCH] fix: sync ActiveTurnState.auto_approve when remember is set When a user checks 'Remember for this tool' and approves a tool call, remember_thread_auto_approve() only persisted thread.auto_approve to disk but did not update the in-memory ActiveTurnState for the current turn. This meant subsequent tool calls within the same turn would still require manual approval, making the remember checkbox appear non-functional. Now remember_thread_auto_approve() also sets ActiveTurnState.auto_approve = true, so active_turn_flags() returns the correct value and the approval_decision() logic auto-approves remaining tool calls in the current turn. --- crates/tui/src/runtime_threads.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/tui/src/runtime_threads.rs b/crates/tui/src/runtime_threads.rs index 787142ba4..41b8f35d1 100644 --- a/crates/tui/src/runtime_threads.rs +++ b/crates/tui/src/runtime_threads.rs @@ -865,6 +865,15 @@ impl RuntimeThreadManager { err ); } + + { + let mut active = self.active.lock().await; + if let Some(state) = active.engines.get_mut(thread_id) { + if let Some(turn) = state.active_turn.as_mut() { + turn.auto_approve = true; + } + } + } } #[must_use]