Skip to content

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

fix(web_chat): handle channel event for parallel turn start

Steven Enamakelb681bda05f45
diff --git a/crates/openhuman-core/src/web_chat/channel_event.rs b/crates/openhuman-core/src/web_chat/channel_event.rs
index 0ca2f1a56d..3444c05a64 100644
--- a/crates/openhuman-core/src/web_chat/channel_event.rs
+++ b/crates/openhuman-core/src/web_chat/channel_event.rs
@@ -61,6 +61,17 @@ pub struct WebChannelEvent {
/// — FE should not promise a fallback".
#[serde(skip_serializing_if = "Option::is_none")]
pub error_fallback_available: Option<bool>,
+ /// Stable i18n key of the failure-copy table row behind `message`
+ /// (`chat_error.<class>`). `message` is always the finished English copy;
+ /// a UI that knows the key renders it in the user's locale instead and
+ /// falls back to `message` for an unknown key. Absent on error types that
+ /// have no table row (cancellation, guardrail, tool errors).
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub copy_key: Option<String>,
+ /// Values `copy_key`'s copy needs: `retry_after_secs`, `provider`,
+ /// `detail` (the sanitized provider error quoted under the copy).
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub copy_params: Option<serde_json::Value>,
/// Name of the tool being called.
#[serde(skip_serializing_if = "Option::is_none")]
pub tool_name: Option<String>,
diff --git a/crates/openhuman-core/src/web_chat/ops/parallel_turn.rs b/crates/openhuman-core/src/web_chat/ops/parallel_turn.rs
index 1c827201b1..2b0143948a 100644
--- a/crates/openhuman-core/src/web_chat/ops/parallel_turn.rs
+++ b/crates/openhuman-core/src/web_chat/ops/parallel_turn.rs
@@ -166,6 +166,8 @@ pub(crate) async fn spawn_parallel_turn(
error_retry_after_ms: classified.retry_after_ms,
error_provider: classified.provider,
error_fallback_available: classified.fallback_available,
+ copy_key: Some(classified.copy_key.to_string()),
+ copy_params: classified.copy_params,
..Default::default()
});
}
diff --git a/crates/openhuman-core/src/web_chat/ops/start_chat.rs b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
index ed484ed95d..0df542b6a8 100644
--- a/crates/openhuman-core/src/web_chat/ops/start_chat.rs
+++ b/crates/openhuman-core/src/web_chat/ops/start_chat.rs
@@ -619,6 +619,8 @@ pub async fn start_chat(
error_retry_after_ms: classified.retry_after_ms,
error_provider: classified.provider,
error_fallback_available: classified.fallback_available,
+ copy_key: Some(classified.copy_key.to_string()),
+ copy_params: classified.copy_params,
..Default::default()
})
}