Fix: skip empty CoT nodes, expand AST children in conscious screen, timestamps

Parser skips Thinking nodes that are just whitespace. Conscious screen
now shows assistant children (Content, Thinking, ToolCall) as nested
tree items via recursive node_to_view. Nodes get timestamped in
push_node and on assistant branch creation.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-08 17:18:48 -04:00
parent 5ec2ff95d8
commit 1b6664ee1c
3 changed files with 28 additions and 18 deletions

View file

@ -528,7 +528,9 @@ impl ResponseParser {
self.buf = self.buf[end + 8..].to_string();
self.in_think = false;
let text = std::mem::take(&mut self.think_buf);
self.push_child(ctx, AstNode::thinking(text));
if !text.trim().is_empty() {
self.push_child(ctx, AstNode::thinking(text));
}
continue;
}
None => {