chore: guard the v0 legacy bridge against non-renderer training clients - #1613
Merged
mikasenghaas merged 1 commit intoJun 10, 2026
Merged
Conversation
_v0_client hardcoded a v0 renderer (token-in/out) client. prime-rl trains renderer-only, so that's correct today, but a MITO (chat-completions, type="openai") config would have silently built a renderer client and done the wrong inference mode instead of erroring. Raise on a non-renderer client config, and now that the type is guaranteed, read the renderer fields directly instead of via defensive getattr. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mikasenghaas
marked this pull request as ready for review
June 10, 2026 22:38
Contributor
ApprovabilityVerdict: Approved Small validation change that adds an explicit type guard to the v0 legacy bridge, failing fast with a clear error message when a non-renderer client is passed instead of silently using defaults. This is defensive hardening with limited scope. You can customize Macroscope's approvability policy. Learn more. |
mikasenghaas
added a commit
that referenced
this pull request
Jun 10, 2026
…#1615) The orchestrator drives eval rollouts of v0 envs through the same LegacyEnvServer (run_rollout/run_group -> _run_v0 -> _v0_client), and eval uses an OpenAI chat-completions client. The #1613 guard raised on any non-renderer config, so it broke v0 eval ("MITO ... not supported"). Dispatch on the config type instead: a renderer config (training, TITO) builds a v0 renderer client; an OpenAI config (eval) builds a v0 chat-completions client. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pull Bot
pushed a commit
to Stars1233/verifiers
that referenced
this pull request
Jun 23, 2026
…ts (PrimeIntellect-ai#1613) _v0_client hardcoded a v0 renderer (token-in/out) client. prime-rl trains renderer-only, so that's correct today, but a MITO (chat-completions, type="openai") config would have silently built a renderer client and done the wrong inference mode instead of erroring. Raise on a non-renderer client config, and now that the type is guaranteed, read the renderer fields directly instead of via defensive getattr. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pull Bot
pushed a commit
to Stars1233/verifiers
that referenced
this pull request
Jun 23, 2026
…PrimeIntellect-ai#1615) The orchestrator drives eval rollouts of v0 envs through the same LegacyEnvServer (run_rollout/run_group -> _run_v0 -> _v0_client), and eval uses an OpenAI chat-completions client. The PrimeIntellect-ai#1613 guard raised on any non-renderer config, so it broke v0 eval ("MITO ... not supported"). Dispatch on the config type instead: a renderer config (training, TITO) builds a v0 renderer client; an OpenAI config (eval) builds a v0 chat-completions client. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Hardens the v0 legacy bridge's training client builder (
LegacyEnvServer._v0_client)._v0_clienthardcoded a v0 renderer (token-in/out) client. That's correct today — prime-rl trains renderer-only (the orchestrator's student and teacher pools both pintrain_client_type="renderer", and it isn't a user-config knob).ClientConfigis a discriminated union (type="renderers"vstype="openai"/MITO). A MITO config reaching this path would have silently built a renderer client from anOpenAIClientConfig(its missingrenderer/renderer_model_namefall back viagetattr), doing TITO instead of the requested MITO rather than failing.Now:
ValueErrorif_v0_clientgets a non-renderer config — MITO (chat-completions) training of v0 envs isn't supported, so fail loudly instead of running the wrong inference mode.renderer/renderer_model_name/pool_sizedirectly instead of via defensivegetattr.This is the natural seam at which to add real
type="openai"dispatch if MITO training of v0 envs is ever enabled.Verification
ruff check --isolated/ruff format --isolated --checkclean._v0_clientraisesValueErroron anOpenAIClientConfig; aRendererClientConfigflows through unchanged.Note
Guard
LegacyEnvServer._v0_clientagainst non-renderer training clientsAdds a strict
isinstancecheck in_v0_clientthat raisesValueErrorwhenclient_configis not aRendererClientConfig. Also replacesgetattr-based access with direct attribute reads forrenderer_model_name,renderer, andpool_size.Macroscope summarized aef8445.
Note
Low Risk
Narrow guard in the legacy training path; renderer configs behave as before, with clearer failure for unsupported MITO training.
Overview
LegacyEnvServer._v0_clientnow requires aRendererClientConfig. If training passes anOpenAIClientConfig(MITO / chat-completions), it raises aValueErrorinstead of silently building a renderer client with missing fields and running token-in/token-out training.After the type check,
renderer,renderer_model_name, andpool_sizeare read directly on the config (nogetattrfallbacks).Reviewed by Cursor Bugbot for commit aef8445. Bugbot is set up for automated code reviews on this repo. Configure here.