Kill TextDelta, Info — UiMessage is dead. RAII ActivityGuards replace all status feedback
Streaming text now goes directly to agent entries via append_streaming(). sync_from_agent diffs the growing entry each tick. The streaming entry is popped when the response completes; build_response_message pushes the final version. All status feedback uses RAII ActivityGuards: - push_activity() for long-running work (thinking, streaming, scoring) - notify() for instant feedback (compacted, DMN state changes, commands) - Guards auto-remove on Drop, appending "(complete)" and lingering 5s - expire_activities() cleans up timed-out notifications on render tick UiMessage enum reduced to a single Info variant with zero sends. The channel infrastructure remains for now (Mind/Agent still take UiSender in signatures) — mechanical cleanup for a follow-up. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
e7914e3d58
commit
cfddb55ed9
9 changed files with 201 additions and 186 deletions
|
|
@ -259,6 +259,7 @@ impl Mind {
|
|||
let mut ag = self.agent.lock().await;
|
||||
if ag.last_prompt_tokens() > threshold {
|
||||
ag.compact();
|
||||
ag.notify("compacted");
|
||||
}
|
||||
}
|
||||
MindCommand::Score => {
|
||||
|
|
@ -381,7 +382,7 @@ impl Mind {
|
|||
let _ = self.turn_watch.send(false);
|
||||
|
||||
if let Some(name) = model_switch {
|
||||
crate::user::chat::cmd_switch_model(&self.agent, &name, &self.ui_tx).await;
|
||||
crate::user::chat::cmd_switch_model(&self.agent, &name).await;
|
||||
}
|
||||
|
||||
// Post-turn maintenance
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue