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:
ProofOfConcept 2026-04-05 21:34:27 -04:00
parent 1745e03550
commit eafc2887a3
7 changed files with 32 additions and 76 deletions

View file

@ -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

View file

@ -315,14 +315,6 @@ fn diff_mind_state(
dirty: &mut bool,
) {
if cur.dmn.label() != prev.dmn.label() || cur.dmn_turns != prev.dmn_turns {
let _ = ui_tx.send(UiMessage::StatusUpdate(ui_channel::StatusInfo {
dmn_state: cur.dmn.label().to_string(),
dmn_turns: cur.dmn_turns,
dmn_max_turns: cur.max_dmn_turns,
prompt_tokens: 0, completion_tokens: 0,
model: String::new(), turn_tools: 0,
context_budget: String::new(),
}));
*dirty = true;
}
// Input consumed — Mind started a turn with it

View file

@ -74,15 +74,6 @@ pub enum UiMessage {
/// Streaming text delta — routed to conversation or autonomous pane.
TextDelta(String, StreamTarget),
/// DMN state annotation: [dmn: foraging (3/20)].
DmnAnnotation(String),
/// Status bar update.
StatusUpdate(StatusInfo),
/// Live activity indicator for the status bar.
Activity(String),
/// Reasoning/thinking tokens from the model (internal monologue).
Reasoning(String),
@ -92,11 +83,6 @@ pub enum UiMessage {
/// Informational message — goes to conversation pane (command output, etc).
Info(String),
/// Context loading details — stored for the debug screen.
ContextInfoUpdate(ContextInfo),
/// Agent cycle state update — refreshes the F2 agents screen.
AgentUpdate(Vec<crate::subconscious::subconscious::AgentSnapshot>),
}
/// Sender that fans out to both the TUI (mpsc) and observers (broadcast).
@ -128,6 +114,3 @@ pub fn channel() -> (UiSender, UiReceiver) {
let (observe_tx, _) = broadcast::channel(1024);
(UiSender { tui: tui_tx, observe: observe_tx }, tui_rx)
}
/// Replay a restored session into the TUI panes so the user can see
/// conversation history immediately on restart. Shows user input,