fix: emit user-facing message on compaction failure (#7975)

Signed-off-by: Rabi Mishra <mishra.rabi@gmail.com>
This commit is contained in:
Rabi Mishra
2026-03-19 15:22:40 +05:30
committed by GitHub
parent 28a52e36ff
commit c97fbb9f3c
+5
View File
@@ -1533,6 +1533,11 @@ impl Agent {
Err(e) => {
crate::posthog::emit_error("compaction_failed", &e.to_string());
error!("Compaction failed: {}", e);
yield AgentEvent::Message(
Message::assistant().with_text(
format!("Ran into this error trying to compact: {e}.\n\nPlease try again or create a new session")
)
);
break;
}
}