mirror of
https://github.com/headroomlabs-ai/headroom.git
synced 2026-11-22 13:29:19 +08:00
fix(proxy): say a forwarded streaming error came from the provider
The old line, "Forwarding upstream streaming error status=429", read to a user as if the proxy might have made the 429 itself. Name the provider as the source and say the error goes to the client. Fields are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1479,7 +1479,7 @@ class StreamingMixin:
|
||||
|
||||
if upstream_response.status_code >= 400:
|
||||
logger.warning(
|
||||
"[%s] Forwarding upstream streaming error status=%s url=%s",
|
||||
"[%s] Upstream provider returned an error; forwarding it to the client status=%s url=%s",
|
||||
request_id,
|
||||
upstream_response.status_code,
|
||||
url,
|
||||
|
||||
@@ -493,7 +493,7 @@ class TestStreamingRatelimitHeaderForwarding:
|
||||
assert result.body == b'{"error":{"message":"capacity exhausted"}}'
|
||||
assert result.headers.get("content-encoding") is None
|
||||
fake_logger.warning.assert_any_call(
|
||||
"[%s] Forwarding upstream streaming error status=%s url=%s",
|
||||
"[%s] Upstream provider returned an error; forwarding it to the client status=%s url=%s",
|
||||
"test-http-error",
|
||||
503,
|
||||
"https://api.anthropic.com/v1/messages",
|
||||
|
||||
Reference in New Issue
Block a user