add RolloutGatewayMixin for server-side rollout execution#954
Merged
Conversation
… prevent rubric KeyError on early rollout failures
Member
|
Hm what's the use case here? Would prefer we don't hardcode in vLLM-specific assumptions at the env pattern level, can we make this more endpoint-agnostic? |
Member
|
if it truly needs to be baked in to the class, would be better if it's something like a mixin and then toggled on/off via an env-level class attribute, so that eval model is still supported with other endpoints. |
Member
mikasenghaas
left a comment
There was a problem hiding this comment.
nice, this looks pretty clean!
RolloutGatewayEnv for server-side rollout executionRolloutGatewayMixin for server-side rollout execution
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
willccbb
approved these changes
Feb 24, 2026
willccbb
approved these changes
Feb 24, 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.
Description
Adds RolloutGatewayMixin, a new experimental environment that offloads agent execution to sandboxes that talk directly to the vLLM rollout gateway.
The env handles sandbox lifecycle, rollout registration/unregistration, trajectory fetch, and reward — the sandboxed agent drives its own inference loop through a prime tunnel URL.
depends on PrimeIntellect-ai/prime-rl#1757
example env PrimeIntellect-ai/research-environments#162
Type of Change
Testing
uv run pytestlocally.Checklist
Additional Notes
Note
Medium Risk
Adds a new rollout execution path that changes sandbox env var wiring and depends on external gateway/tunnel behavior; failures could affect agent rollouts despite being opt-in and covered by new tests.
Overview
Introduces experimental
RolloutGatewayMixinthat can be composed withCliAgentEnvto switch rollouts from interception-based request proxying to a server-side rollout gateway flow: it registers/unregisters rollouts with the gateway, starts a Prime Tunnel to the gateway host, launches the agent sandbox withOPENAI_BASE_URLpointing at the tunneled.../v1/rollouts/<id>endpoint, then fetches the full trajectory back intostate.Refactors
CliAgentEnvinterception initialization intoinit_interception()so gateway mode can skip creating the interception server, and adjusts cleanup/teardown to tolerate interception being absent;Environment.init_statenow initializesstate["completion"]toNoneso gateway mode can populate it later. ExposesRolloutGatewayMixinviaverifiers.__init__/envs.experimental.__init__, updates environment docs to mention the mixin, and adds integration tests covering gateway/tunnel behavior and theuse_gateway=Falsefallback path.Written by Cursor Bugbot for commit 21d45c0. This will update automatically on new commits. Configure here.