[2/5][BREAKING][rollout] feat: add the polling RolloutClient - #346
Draft
mathewjhan wants to merge 6 commits into
Draft
[2/5][BREAKING][rollout] feat: add the polling RolloutClient#346mathewjhan wants to merge 6 commits into
mathewjhan wants to merge 6 commits into
Conversation
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(). RemovesHttpRolloutDriver,RolloutRunRequest, andRolloutOutcome.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
RolloutClientandRolloutResultResponse. 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.