Skip to content

Support streamable runner payloads - #80

Open
j0sh wants to merge 2 commits into
mainfrom
ja/call-body
Open

j0sh wants to merge 2 commits into
mainfrom
ja/call-body

Conversation

@j0sh

@j0sh j0sh commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Accept dicts, text, bytes, binary files, and async byte streams with
an optional content type. Send omitted and None payloads as empty bodies.

Add StreamPayload(source=...) for streaming data sources. To accommodate 402
(payment) and other error response codes without consuming the payload,
the client sends an Expect: 100-continue and waits for the 100 before
transmitting the body. This is something that most HTTP servers do by
default already, including golang's. Bounded (non-streaming) inputs do
not wait for the 100.

In the case that there is still an error after payment, streaming input is
buffered for replay during runner failover (optional, but enabled by
default). Seekable files are rewound instead of buffered.

This is API-compatible with existing callers, with a few tweaks:

  • None payloads now don't send a body, instead of {}
  • stream=True (response streaming) now honors timeout instead of
    using a fixed 10s

Also remove an unused Label field from runner registration.

j0sh added 2 commits October 16, 2026 12:07
Accept dicts, text, bytes, binary files, and async byte streams with
an optional content type. Send omitted and None payloads as empty bodies.

Add StreamPayload(source=...) for streaming data sources. To accommodate 402
(payment) and other error response codes without consuming the payload,
the client sends an `Expect: 100-continue` and waits for the 100 before
transmitting the body. This is something that most HTTP servers do by
default already, including golang's. Bounded (non-streaming) inputs do
not wait for the 100.

In the case that there is still an error after payment, streaming input is
buffered for replay during runner failover (optional, but enabled by
default). Seekable files are rewound instead of buffered.

This is API-compatible with existing callers, with a few tweaks:

* `None` payloads now don't send a body, instead of `{}`
* `stream=True` (response streaming) now honors `timeout` instead of
  using a fixed 10s

Also remove an unused `Label` field from runner registration.
@j0sh
j0sh requested review from rickstaa and a balanced review from Copilot and removed request for Copilot October 17, 2026 02:15
Comment thread src/livepeer_gateway/_http_continue.py Dismissed
Comment thread src/livepeer_gateway/runner_payload.py Dismissed
Comment thread tests/test_call_runner_uploads.py
Comment thread tests/test_runner_payload.py
Comment thread tests/test_runner_payload.py
Comment thread tests/test_runner_payload.py
Comment thread tests/test_selection.py
Comment thread tests/test_call_runner_uploads.py
Comment thread tests/test_call_runner_uploads.py
@j0sh

j0sh commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator Author

From Codex, on the codequality bot:


For PR #80, seven findings are false positives and two are minor readability suggestions.

  • Seven “statement has no effect” warnings: all flag await statements. Those waits finish cancellation/cleanup, wait for worker I/O, or verify that cancellation raises. I temporarily removed one flagged await: both existing cancellation tests failed, and a task exception went unhandled.
  • Two “empty except” warnings: the test server intentionally ignores disconnects during aborted requests and teardown. Adding a short explanation is reasonable, but these aren’t functional defects.
    On your second question: I should own the substantive review and triage. I reviewed the upload, retry, and cancellation behavior earlier, but hadn’t read these GitHub annotations until you supplied the PR. Running tests and lint alone isn’t sufficient; I should evaluate findings against the code and report which deserve action. Here, I’d keep every flagged await and treat the two comment suggestions as optional.

I'm disabling the codequality bot to reduce noise - cc @rickstaa

@rickstaa

Copy link
Copy Markdown
Member

@j0sh thanks for the pr will review later.

I'm disabling the codequality bot to reduce noise - cc @rickstaa

Yea no problem please keep co-pilot reviews enabled they are good at spoting actual problems.

@rickstaa
rickstaa requested a balanced review from Copilot October 19, 2026 14:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

No deployments
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.

3 participants