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 empty error payloads in web errors

Steven Enamakeleba8d4131b06
diff --git a/src/openhuman/web_chat/web_errors_part_01.rs b/src/openhuman/web_chat/web_errors_part_01.rs
index bf8eab0053..b5374de04c 100644
--- a/src/openhuman/web_chat/web_errors_part_01.rs
+++ b/src/openhuman/web_chat/web_errors_part_01.rs
@@ -133,8 +133,10 @@ pub(crate) fn extract_provider_error_detail(err: &str) -> Option<String> {
let after_colon = after_key.trim_start_matches(|c: char| c != '"');
let stripped = after_colon.strip_prefix('"')?;
- // Manual unescape — handle `\"` and `\\` only; everything else passes
- // through. Sufficient for OpenAI/Anthropic/etc. error bodies.
+ // Manual unescape over the standard JSON escape set. `\uXXXX` is
+ // deliberately left alone rather than decoded: this is an error-display
+ // path, and an unhandled sequence should stay visible as the literal
+ // `\uXXXX` instead of silently losing a character.
let mut out = String::new();
let mut chars = stripped.chars();
while let Some(c) = chars.next() {