Kill StatusUpdate, Activity, DmnAnnotation, ContextInfoUpdate, AgentUpdate
Status bar reads directly from Agent and MindState on each render tick. Activity is now a field on Agent — set by agent code directly, read by UI via try_lock. DmnAnnotation, ContextInfoUpdate, AgentUpdate were already dead (no senders). UiMessage down to 4 variants: TextDelta, Reasoning, Debug, Info. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
1745e03550
commit
eafc2887a3
7 changed files with 32 additions and 76 deletions
|
|
@ -602,31 +602,6 @@ impl InteractScreen {
|
|||
self.autonomous.append_text(text);
|
||||
}
|
||||
},
|
||||
UiMessage::DmnAnnotation(text) => {
|
||||
self.autonomous.push_line(text.clone(), Color::Yellow);
|
||||
self.turn_started = Some(std::time::Instant::now());
|
||||
self.needs_assistant_marker = true;
|
||||
app.status.turn_tools = 0;
|
||||
}
|
||||
UiMessage::StatusUpdate(info) => {
|
||||
if !info.dmn_state.is_empty() {
|
||||
app.status.dmn_state = info.dmn_state.clone();
|
||||
app.status.dmn_turns = info.dmn_turns;
|
||||
app.status.dmn_max_turns = info.dmn_max_turns;
|
||||
}
|
||||
if info.prompt_tokens > 0 { app.status.prompt_tokens = info.prompt_tokens; }
|
||||
if !info.model.is_empty() { app.status.model = info.model.clone(); }
|
||||
if !info.context_budget.is_empty() { app.status.context_budget = info.context_budget.clone(); }
|
||||
}
|
||||
UiMessage::Activity(text) => {
|
||||
if text.is_empty() {
|
||||
self.call_started = None;
|
||||
} else if app.activity.is_empty() || self.call_started.is_none() {
|
||||
self.call_started = Some(std::time::Instant::now());
|
||||
self.call_timeout_secs = crate::config::get().api_stream_timeout_secs;
|
||||
}
|
||||
app.activity = text.clone();
|
||||
}
|
||||
UiMessage::Reasoning(text) => {
|
||||
self.autonomous.current_color = Color::DarkGray;
|
||||
self.autonomous.append_text(text);
|
||||
|
|
@ -637,8 +612,6 @@ impl InteractScreen {
|
|||
UiMessage::Info(text) => {
|
||||
self.conversation.push_line(text.clone(), Color::Cyan);
|
||||
}
|
||||
UiMessage::ContextInfoUpdate(info) => { app.context_info = Some(info.clone()); }
|
||||
UiMessage::AgentUpdate(agents) => { app.agent_state = agents.clone(); }
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
@ -919,6 +892,22 @@ impl ScreenView for InteractScreen {
|
|||
// Sync state from agent
|
||||
self.sync_from_agent();
|
||||
|
||||
// Read status from agent + mind state
|
||||
if let Ok(agent) = self.agent.try_lock() {
|
||||
app.status.prompt_tokens = agent.last_prompt_tokens();
|
||||
app.status.model = agent.model().to_string();
|
||||
app.status.context_budget = agent.budget().status_string();
|
||||
if !agent.activity.is_empty() {
|
||||
app.activity = agent.activity.clone();
|
||||
}
|
||||
}
|
||||
{
|
||||
let mind = self.shared_mind.lock().unwrap();
|
||||
app.status.dmn_state = mind.dmn.label().to_string();
|
||||
app.status.dmn_turns = mind.dmn_turns;
|
||||
app.status.dmn_max_turns = mind.max_dmn_turns;
|
||||
}
|
||||
|
||||
// Draw
|
||||
self.draw_main(frame, area, app);
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue