Kill Reasoning, Debug, Activity variants — read status from Agent directly
Reasoning tokens: dropped for now, will land in context entries later. Debug sends: converted to dbglog! macro (writes to debug.log). Activity: now a field on Agent, set directly, read by UI via try_lock. score_memories_incremental takes agent Arc for activity writes. UiMessage down to 2 variants: TextDelta, Info. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
eafc2887a3
commit
e7914e3d58
7 changed files with 54 additions and 88 deletions
|
|
@ -182,7 +182,7 @@ impl Agent {
|
|||
if !jnl.is_empty() {
|
||||
msgs.push(Message::user(jnl));
|
||||
}
|
||||
msgs.extend(self.context.entries.iter().map(|e| e.api_message().clone()));
|
||||
msgs.extend(self.context.entries.iter().map(|e| e.api_message().clone();
|
||||
msgs
|
||||
}
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ impl Agent {
|
|||
me.push_message(Message::user(format!(
|
||||
"<system-reminder>\n--- subconscious reflection ---\n{}\n</system-reminder>",
|
||||
reflection.trim(),
|
||||
)));
|
||||
);
|
||||
}
|
||||
|
||||
// Collect completed background tool handles — remove from active list
|
||||
|
|
@ -350,7 +350,7 @@ impl Agent {
|
|||
let _ = ui_tx.send(UiMessage::Info(format!(
|
||||
"[context overflow — compacting and retrying ({}/2)]",
|
||||
overflow_retries,
|
||||
)));
|
||||
);
|
||||
me.compact();
|
||||
continue;
|
||||
}
|
||||
|
|
@ -359,7 +359,7 @@ impl Agent {
|
|||
let _ = ui_tx.send(UiMessage::Info(format!(
|
||||
"[stream error: {} — retrying ({}/2)]",
|
||||
e, empty_retries,
|
||||
)));
|
||||
);
|
||||
drop(me);
|
||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||
continue;
|
||||
|
|
@ -395,10 +395,10 @@ impl Agent {
|
|||
if !has_content && !has_tools {
|
||||
if empty_retries < 2 {
|
||||
empty_retries += 1;
|
||||
let _ = ui_tx.send(UiMessage::Debug(format!(
|
||||
dbglog!(
|
||||
"empty response, injecting nudge and retrying ({}/2)",
|
||||
empty_retries,
|
||||
)));
|
||||
);
|
||||
me.push_message(Message::user(
|
||||
"[system] Your previous response was empty. \
|
||||
Please respond with text or use a tool."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue