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:
parent
28d56e2a55
commit
d95f3e9445
1 changed files with 14 additions and 2 deletions
|
|
@ -167,6 +167,7 @@ enum PaneTarget {
|
||||||
ConversationAssistant,
|
ConversationAssistant,
|
||||||
Tools,
|
Tools,
|
||||||
ToolResult,
|
ToolResult,
|
||||||
|
Autonomous,
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_PANE_LINES: usize = 10_000;
|
const MAX_PANE_LINES: usize = 10_000;
|
||||||
|
|
@ -472,8 +473,11 @@ impl InteractScreen {
|
||||||
AstNode::Leaf(leaf) => {
|
AstNode::Leaf(leaf) => {
|
||||||
let text = leaf.body().text().to_string();
|
let text = leaf.body().text().to_string();
|
||||||
match leaf.body() {
|
match leaf.body() {
|
||||||
NodeBody::Memory { .. } | NodeBody::Thinking(_)
|
NodeBody::Memory { .. } | NodeBody::Log(_) | NodeBody::Dmn(_) => vec![],
|
||||||
| NodeBody::Log(_) | NodeBody::Dmn(_) => vec![],
|
NodeBody::Thinking(_) => {
|
||||||
|
if text.is_empty() { vec![] }
|
||||||
|
else { vec![(PaneTarget::Autonomous, text, Marker::None)] }
|
||||||
|
}
|
||||||
NodeBody::Content(_) => {
|
NodeBody::Content(_) => {
|
||||||
if text.is_empty() || text.starts_with("<system-reminder>") { vec![] }
|
if text.is_empty() || text.starts_with("<system-reminder>") { vec![] }
|
||||||
else { vec![(PaneTarget::Conversation, text, Marker::User)] }
|
else { vec![(PaneTarget::Conversation, text, Marker::User)] }
|
||||||
|
|
@ -547,6 +551,12 @@ impl InteractScreen {
|
||||||
self.tools.push_line(format!(" {}", line), Color::DarkGray);
|
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(),
|
=> self.conversation.pop_line(),
|
||||||
PaneTarget::Tools | PaneTarget::ToolResult
|
PaneTarget::Tools | PaneTarget::ToolResult
|
||||||
=> self.tools.pop_line(),
|
=> self.tools.pop_line(),
|
||||||
|
PaneTarget::Autonomous
|
||||||
|
=> self.autonomous.pop_line(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue