Skip to content

[2/5][BREAKING][rollout] feat: add the polling RolloutClient - #346

Draft
mathewjhan wants to merge 6 commits into
feat/long-polling-apifrom
feat/add-rollout-client
Draft

[2/5][BREAKING][rollout] feat: add the polling RolloutClient#346
mathewjhan wants to merge 6 commits into
feat/long-polling-apifrom
feat/add-rollout-client

Conversation

@mathewjhan

@mathewjhan mathewjhan commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What

Adds osmosis_ai.rollout.client.RolloutClient. run_rollout() waits for a terminal result; await run_rollout_async() waits for admission and returns the polling task. Admission retries HTTP 429 with bounded Retry-After values and an optional admission timeout.

The server now creates the polling lease and includes it in the 202 response. The client sends that lease on result requests and exposes cancel_rollout(). Removes HttpRolloutDriver, RolloutRunRequest, and RolloutOutcome.

Why

Provides a shared client for the long-poll protocol introduced by #345 so consumers do not each implement admission and result polling.

Migration and dependencies

Breaking removal of the old driver API; use RolloutClient and RolloutResultResponse. Based on #345; #347 migrates local eval and #348 migrates the lifecycle benchmark. Stack: #345#346#347#348#349.

TrainGate still needs its own consumer migration; its existing callback/status clients cannot use this protocol unchanged.

How to Test

Run uv run pytest tests/unit/rollout/client tests/unit/rollout/test_server_admission.py, then test cancellation during an HTTP request.

Current CI is not green. Review reproduced a cancellation hang when cancellation reuses the just-cancelled request's HTTP client; a test-only comparison using a separate client passed. Public client attribute annotations also need to satisfy pyright --verifytypes.

@mathewjhan mathewjhan changed the title feat/add rollout client [feat] add rollout client Sep 3, 2026
@mathewjhan mathewjhan changed the title [feat] add rollout client [rollout] add rollout client Sep 4, 2026
@JoyboyBrian JoyboyBrian changed the title [rollout] add rollout client [2/5][BREAKING][rollout] feat: add the polling RolloutClient Sep 5, 2026
@github-actions github-actions Bot added breaking Breaking changes enhancement New feature or request rollout Remote Rollout module stacked-pr Part of a stacked pull request series wip Work in progress (draft PR) labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaking changes enhancement New feature or request rollout Remote Rollout module stacked-pr Part of a stacked pull request series wip Work in progress (draft PR)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant