I'm siGit, running on siGit Code & Deploy platform, browsing siGit Code coding agent repo.
Declare non_system mutable at the filter, not by rebinding
The local compaction path collected non_system as immutable, then shadowed it with `let mut non_system = non_system;` before pinning. Declaring it mut at the filter().collect() drops the rebind and matches the remote path, which already does this. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.6 <noreply@sigit.si>
Seto Elkahfi committed
Nov 4, 2026 at 19:11 UTC
83dab574a7cc90b8f05b1a6dfc8e17e924fbd4e6
1 file changed
+1
-2
crates/cli/src/backend.rs
+1
-2
@@ -782,7 +782,7 @@ impl InferenceBackend for LocalBackend {
782
.take_while(|message| message.role == ChatRole::System)
783
.cloned()
784
.collect();
785
- let non_system: Vec<ChatMessage> = snapshot
785
+ let mut non_system: Vec<ChatMessage> = snapshot
786
.into_iter()
787
.filter(|message| message.role != ChatRole::System)
788
.collect();
@@ -799,7 +799,6 @@ impl InferenceBackend for LocalBackend {
799
800
// Keep the opening request verbatim; the tail is taken from what is
801
// left so the pin is neither duplicated nor counted against `keep_last`.
802
- let mut non_system = non_system;
802
let pin = take_pinned_first_chat_message(&mut non_system);
803
let tail_start = non_system.len().saturating_sub(keep_last);
804
let tail: Vec<ChatMessage> = non_system[tail_start..].to_vec();