Skip to content

fix(call_runner): stop asking apps for JSON - #52

Merged
j0sh merged 1 commit into
ja/live-runnerfrom
rs/call-runner-request-headers
Jul 31, 2026
Merged

fix(call_runner): stop asking apps for JSON#52
j0sh merged 1 commit into
ja/live-runnerfrom
rs/call-runner-request-headers

Conversation

@rickstaa

@rickstaa rickstaa commented Jul 30, 2026

Copy link
Copy Markdown
Member

Stacked on #51 (base rs/call-runner-raw-bytes), which handles the response side. Without this, its non-JSON branch is unreachable for the apps it targets.

_json_request_parts hardcodes Accept: application/json on every SDK request. Right for the control plane, but call_runner talks to arbitrary app code, so it asserts a preference the caller never made, and an upstream that content-negotiates obliges. From the api-proxy example, which advertises raw JPEG bytes:

no Accept header          -> image/jpeg,       28819 bytes
Accept: application/json  -> application/json, base64 PNG in a JSON string

The client wrote 1.9 MB of base64 text to a .jpg.

App calls now send Accept: */* and let the app, or the upstream it fronts, pick. Control plane untouched, http.py unchanged. */* rather than omitting the header: aiohttp sends it anyway, so this only makes the choice visible.

JSON apps are unaffected, since json_response sets its own content type and the buffered path branches on the response. No headers argument for now: no caller needs to negotiate, and it can be added later without breaking anyone.

Verified against api-proxy: a real Hugging Face call now returns a 1024x1024 image/jpeg. Suite passes (16).

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 716d9198-edc7-4a8c-a535-7846ec92102f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rickstaa
rickstaa force-pushed the rs/call-runner-request-headers branch from b9b24b2 to 5483803 Compare July 30, 2026 10:48
@rickstaa rickstaa changed the title fix(call_runner): stop dictating the response format fix(call_runner): stop asking apps for JSON Jul 30, 2026
@rickstaa
rickstaa force-pushed the rs/call-runner-request-headers branch 2 times, most recently from 47cd45d to 88cdbb8 Compare July 30, 2026 10:51
@j0sh

j0sh commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks, I'm trying to remember if this was put in place for a reason. Will take a closer look

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) <noreply@anthropic.com>
@j0sh
j0sh force-pushed the rs/call-runner-request-headers branch from 88cdbb8 to a7054f7 Compare July 31, 2026 21:08
Base automatically changed from rs/call-runner-raw-bytes to ja/live-runner July 31, 2026 21:11
@j0sh
j0sh merged commit a7054f7 into main Jul 31, 2026
5 of 7 checks passed
@j0sh
j0sh deleted the rs/call-runner-request-headers branch July 31, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants