Skip to content

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

refactor(channels): improve error handling and agent ID selection

Steven Enamakel82cc625680e9
diff --git a/crates/openhuman-core/src/channels/routes.rs b/crates/openhuman-core/src/channels/routes.rs
index e981799527..26f13962a6 100644
--- a/crates/openhuman-core/src/channels/routes.rs
+++ b/crates/openhuman-core/src/channels/routes.rs
@@ -231,8 +231,8 @@ where
);
}
if clear_history {
- if let Err(error) = reset_history().await {
- tracing::warn!("channel durable history reset failed: {error}");
+ if reset_history().await.is_err() {
+ tracing::warn!("channel durable history reset failed");
if let Some(channel) = target_channel {
let copy = crate::web_chat::classify_inference_error(
"OpenHuman session persistence failed while resetting this conversation",
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs
index 87c5089bf6..7752270c77 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/mod.rs
@@ -46,7 +46,7 @@ pub(crate) async fn configured_agent(
.await
.map_err(|error| error.to_string())?,
};
- let agent_id = "orchestrator";
+ let agent_id = crate::web_chat::pick_target_agent_id(&config);
config.chat_provider = Some(
if route.provider == crate::inference::provider::INFERENCE_BACKEND_ID {
crate::inference::provider::INFERENCE_BACKEND_ID.to_string()