Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(embed): log dispatch errors in agent turn

Steven Enamakel4397a044bb4e
diff --git a/src/embed/agent.rs b/src/embed/agent.rs
index 17de0da0b8..03157458c7 100644
--- a/src/embed/agent.rs
+++ b/src/embed/agent.rs
@@ -309,7 +309,18 @@ impl Turn<'_> {
crate::openhuman::agent::progress_sink::with_progress_sink(sink, dispatch).await
}
(None, None) => dispatch.await,
- }?;
+ }
+ .map_err(|err| {
+ // Log a redacted failure event so dispatch errors are visible in
+ // host logs without spilling the request, credentials, or working
+ // directory. [`CoreError`]'s Debug is already sanitized by the core
+ // (it never carries the route credentials), so naming the session
+ // alongside it is safe.
+ log::debug!(
+ "[embed][agent] turn_failed session={session_id} error={err:?}"
+ );
+ err
+ })?;
log::debug!(
"[embed][agent] turn_completed session={session_id} reply_len={}",