From a7054f725642e0e52db4c1af404a347984f505d3 Mon Sep 17 00:00:00 2001 From: Rick Staa Date: Thu, 30 Jul 2026 12:48:39 +0200 Subject: [PATCH] fix(call_runner): stop asking apps for JSON One helper builds every SDK request and hardcodes Accept: application/json. That is right for the control plane, where the orchestrator is a JSON API, but call_runner is the one function whose destination is arbitrary app code. An upstream that content negotiates then answers in JSON because the SDK asked: the api-proxy example advertises raw JPEG bytes and Hugging Face returned a base64 PNG in a JSON string, so the client wrote base64 text to a .jpg. App calls now state no preference and let the app pick. Co-Authored-By: Claude Opus 5 (1M context) --- src/livepeer_gateway/live_runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/livepeer_gateway/live_runner.py b/src/livepeer_gateway/live_runner.py index 0f46426..2d06836 100644 --- a/src/livepeer_gateway/live_runner.py +++ b/src/livepeer_gateway/live_runner.py @@ -746,6 +746,8 @@ async def call_runner( ``application/json`` and ``+json`` types parse into ``result.data``; anything else (an image, ndjson) comes back unparsed in ``result.content`` + ``result.content_type``. + + The request asks for no particular format, so the app picks what it returns. """ runner_url = runner_url.strip() or (runner.url.strip() if runner is not None else "") if not runner_url: @@ -761,7 +763,9 @@ async def call_runner( payment_session: LivePaymentSession | None = None payment_type = "" session_id = "" - request_headers: dict[str, str] = {} + # No preferred format: the app, or the upstream it fronts, picks. Only + # control-plane calls ask for JSON. + request_headers: dict[str, str] = {"Accept": "*/*"} if signer_url: request_headers[_LIVE_RUNNER_PAYER_ADDRESS_HEADER] = payer_address # Pending challenge means payment is needed.