Skip to content

fix(lib): non-streaming proxy path ignores upstream status #453

Description

@cswaney

Context

In `proxy_service` (`lib/src/blackfish/server/asgi.py`), the streaming branch checks `upstream_res.is_success` and forwards the upstream status code + error message. The non-streaming branch (`asyncpost`) calls `response.json()` unconditionally with no status check.

Consequence: a downstream service error on the non-streaming path (e.g. a malformed audio file returning a 4xx/5xx with a JSON error body) is returned to the frontend as if it were a success. The UI then can't reliably distinguish a real failure from a valid transcription — undermining the "Transcription failed" vs "Transcription timed out" surfacing.

Task

Make the non-streaming proxy branch forward upstream non-2xx responses as errors, mirroring the streaming branch: check status, extract the upstream error message, and raise an `HTTPException` with the upstream status code.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions