fix(v1): forward sampling parameters across dialects - #2425
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02fd7a62d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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.
Reviewed by Cursor Bugbot for commit ad95f52. Configure here.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR changes effective generation requests across three provider dialects and the training renderer by forwarding arbitrary sampling fields, flattening You can add or adjust custom eligibility rules. Learn more. |

Overview
Forward eval sampling parameters consistently across Chat Completions, Responses, Anthropic Messages, and training requests.
Details
Note
Medium Risk
Changes how sampling overrides are merged into provider requests, which can alter generation (max tokens, reasoning, extra_body). Logic is localized to dialect override paths, not auth or data handling.
Overview
Eval sampling now reaches Chat Completions, Responses, Anthropic Messages, and training requests through a shared
SamplingConfig.wire_args()helper. That flattens OpenAI-styleextra_bodyinto top-level wire args (typed knobs win), so extra provider fields are no longer dropped.Dialect
apply_overridespaths merge those flattened args instead of a small hardcoded subset, while still remapping protocol-specific keys (max_tokens→max_output_tokens,reasoning_effortinto reasoning/output_config). Chat Completions drops conflictingmax_tokens/max_completion_tokensaliases when the eval supplies either.service_tieris recorded in each dialect’s sampling metadata.Reviewed by Cursor Bugbot for commit b4d847b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Forward sampling parameters across v1 dialects via
wire_argsSamplingConfig.wire_args()to flatten non-None fields, liftextra_bodyvalues, and resolvemax_tokensvsmax_completion_tokensconflicts.TrainClientand all dialects (Anthropic,Chat,Responses) to usewire_args()instead of manualmodel_dumplogic.service_tiertosampling_fieldsfor all dialects.output_config/reasoning_effortfor Anthropic and Responses, and mapsmax_tokenstomax_output_tokensfor Responses.AnthropicDialectnow preserves bodytemperatureandtop_punless explicitly overridden;ChatDialectdrops bothmax_tokensandmax_completion_tokensfrom the body when any max token override is provided.Macroscope summarized b4d847b.