From baa8d1ba6e9e2620e60fbad95eb6a911934eb4aa Mon Sep 17 00:00:00 2001 From: TheArchitectit Date: Wed, 29 Apr 2026 20:42:46 -0500 Subject: [PATCH] fix: detect HTML responses in streaming path When a provider returns HTML (e.g., error page, wrong endpoint) instead of JSON in an SSE stream, provide a clear error message instead of hanging or failing with a cryptic parse error. Co-Authored-By: Claude Opus 4.7 --- rust/crates/api/src/providers/openai_compat.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rust/crates/api/src/providers/openai_compat.rs b/rust/crates/api/src/providers/openai_compat.rs index f6d7a349..42fdce76 100644 --- a/rust/crates/api/src/providers/openai_compat.rs +++ b/rust/crates/api/src/providers/openai_compat.rs @@ -1588,6 +1588,7 @@ fn parse_sse_frame( body: payload.chars().take(200).collect(), retryable: false, suggested_action: Some("verify the API endpoint URL is correct".to_string()), + retry_after: None, }); } serde_json::from_str::(&payload)