Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/tui/src/runtime_threads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Comment on lines +869 to +876
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The in-memory synchronization logic added here is shadowed by the early return at line 857. If thread.auto_approve is already true in the persisted record (which can happen if a turn was started with an explicit auto_approve = false override), the function returns before reaching this block. To ensure the current turn is always updated when the user selects "Remember", the persistence logic should be decoupled from the in-memory update, and the early returns at lines 853 and 856 should be refactored to allow the sync to proceed even if the persisted state is already up-to-date or if loading the thread fails. Additionally, consider adding a test case that verifies in-memory sync when a turn override is present.

}

#[must_use]
Expand Down