Skip to content

feat: add SSE/chunked streaming to call_runner#25

Open
rickstaa wants to merge 1 commit into
ja/live-runnerfrom
rs/live-runner-streaming
Open

feat: add SSE/chunked streaming to call_runner#25
rickstaa wants to merge 1 commit into
ja/live-runnerfrom
rs/live-runner-streaming

Conversation

@rickstaa

@rickstaa rickstaa commented Jun 15, 2026

Copy link
Copy Markdown
Member

What

Adds streaming support to call_runner for SSE / chunked responses, on top of the live-runner work in #20.

  • http.open_stream() — opens an HTTP request and hands back the live (session, response) without reading the body, for streaming responses. Caller owns both. No total timeout (streams run indefinitely); only connect/first-byte are bounded. Raises LivepeerHTTPError on >= 400.
  • LiveRunnerCallStream — returned by call_runner(..., stream=True). Owns the aiohttp session/response, is an async context manager (or call aclose()), and exposes the body via aiter_bytes() / aiter_lines() plus status/headers/content_type/runner.
  • Payment — streaming reuses the existing per-call 402 challenge/retry path. open_stream raises before any body, so the payment retry catches it exactly like the non-streaming path.
  • Export LiveRunnerCallStream from the package root.

Notes

  • Continuous/per-segment payment remains the trickle/lv2v path; this SSE path is one job, one upfront payment.

Add open_stream() for unbuffered streaming HTTP responses, and a
LiveRunnerCallStream handle returned by call_runner(..., stream=True).
The stream owns its aiohttp session/response, works as an async context
manager (aclose for cleanup), and exposes the body via aiter_bytes /
aiter_lines plus status/headers/content_type.

Payment reuses the existing 402 challenge/retry path: open_stream raises
LivepeerHTTPError on >= 400 before any body, so the streaming and
non-streaming branches share the same per-call payment handling. Export
LiveRunnerCallStream from the package root.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 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

Run ID: 9c4cc2e9-fed8-4476-880a-3702a75e3df8

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rs/live-runner-streaming

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 and usage tips.

@rickstaa rickstaa requested a review from j0sh June 15, 2026 10:50
@rickstaa rickstaa changed the title Add SSE/chunked streaming to call_runner feat: add SSE/chunked streaming to call_runner Jun 15, 2026
@linear-code

linear-code Bot commented Jun 15, 2026

Copy link
Copy Markdown

ENG-110

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.

1 participant