Fix restore_from_log panic on Thinking entries, fix bail nullglob

restore_from_log called .message() on all entries including Thinking
entries, which panic. Filter them out alongside Log entries.

Also fix bail-no-competing.sh: without nullglob, when no pid-* files
exist the glob stays literal and always triggers a false bail.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 10:39:07 -04:00
parent 06176201da
commit 70ee7abea5
2 changed files with 5 additions and 3 deletions

View file

@ -930,7 +930,7 @@ impl Agent {
// Load extra — compact() will dedup, trim, reload identity + journal
let all: Vec<ContextEntry> = entries.into_iter()
.filter(|e| !e.is_log() && e.message().role != Role::System)
.filter(|e| !e.is_log() && !e.is_thinking() && e.message().role != Role::System)
.map(|e| {
let tokens = if e.is_log() { 0 } else {
context::msg_token_count(&self.tokenizer, e.api_message())