user/chat: route Thinking to a new Autonomous pane

Thinking content was silently dropped in the UI (empty Vec). Now that
Thinking is prompt-visible, surface it in a dedicated Autonomous pane
rendered in gray so it's visually distinct from conversation and
tool-call output.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-23 23:41:38 -04:00
parent 28d56e2a55
commit d95f3e9445

View file

@ -167,6 +167,7 @@ enum PaneTarget {
ConversationAssistant,
Tools,
ToolResult,
Autonomous,
}
const MAX_PANE_LINES: usize = 10_000;
@ -472,8 +473,11 @@ impl InteractScreen {
AstNode::Leaf(leaf) => {
let text = leaf.body().text().to_string();
match leaf.body() {
NodeBody::Memory { .. } | NodeBody::Thinking(_)
| NodeBody::Log(_) | NodeBody::Dmn(_) => vec![],
NodeBody::Memory { .. } | NodeBody::Log(_) | NodeBody::Dmn(_) => vec![],
NodeBody::Thinking(_) => {
if text.is_empty() { vec![] }
else { vec![(PaneTarget::Autonomous, text, Marker::None)] }
}
NodeBody::Content(_) => {
if text.is_empty() || text.starts_with("<system-reminder>") { vec![] }
else { vec![(PaneTarget::Conversation, text, Marker::User)] }
@ -547,6 +551,12 @@ impl InteractScreen {
self.tools.push_line(format!(" {}", line), Color::DarkGray);
}
}
PaneTarget::Autonomous => {
self.autonomous.current_color = Color::Gray;
self.autonomous.append_text(&text);
self.autonomous.pending_marker = marker;
self.autonomous.flush_pending();
}
}
}
}
@ -558,6 +568,8 @@ impl InteractScreen {
=> self.conversation.pop_line(),
PaneTarget::Tools | PaneTarget::ToolResult
=> self.tools.pop_line(),
PaneTarget::Autonomous
=> self.autonomous.pop_line(),
}
}
}