Repository navigation
fix: openai reasoning and params fixes - #7239
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: maximhq/bifrost/.coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review. 📝 SummarySummary by CodeRabbit
WalkthroughOpenAI and Azure chat and responses requests now normalize reasoning effort and filter sampling parameters by model capabilities. Tests cover model defaults, conditional support, caller-parameter preservation, and logprob include filtering. ChangesOpenAI parameter handling
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant RequestConversion
participant ModelCapabilities
participant OpenAIOrAzureAPI
Client->>RequestConversion: provide reasoning and sampling parameters
RequestConversion->>ModelCapabilities: resolve effort and field support
ModelCapabilities-->>RequestConversion: return normalization and filtering decisions
RequestConversion->>OpenAIOrAzureAPI: send normalized request
Merge Risk: ⚪ Minimal · up to The reviewed change is mergeable; no current-head defects were identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
12b8b3b to
9c0b34c
Compare
9c0b34c to
a038118
Compare
a8411cd to
9e9c92b
Compare
The base branch was changed.
Merge activity
|

Summary
Extends the sampling-parameter stripping logic to cover
temperature,top_logprobs, andlogprobsin addition to the existingtop_pgate, and ensures that models which cannot disable reasoning (o-series, GPT-5 base/pro, GPT-6) have a"none"effort remapped to their lowest accepted level rather than forwarded to the API.Changes
topPUnsupportedtosamplingParamUnsupported, generalizing it to accept any field name (top_p,temperature,top_logprobs,logprobs) and applying the same datasheet-driven + name-fallback logic to all four.stripUnsupportedSamplingParamsonOpenAIChatRequestand wired it intoToOpenAIChatRequestfor OpenAI and Azure providers.ToOpenAIResponsesRequestto striptemperature,top_logprobs, andlogprobs(in addition totop_p) for OpenAI/Azure hosts only; third-party OpenAI-compatible hosts (e.g. Groq) are left untouched.logprobsis unsupported, the"message.output_text.logprobs"entry is removed fromIncludeby cloning the slice first to avoid mutating the caller's params.defaultCanDisableReasoningandomittedEffortReasonshelpers toutils.goto correctly model which models default to"none"effort when omitted (GPT-5.1–5.4) versus which always reason (GPT-5-pro, GPT-6, o-series).reasoning.effortnow counts as"none"only for models whose default is"none"(GPT-5.1–5.4); for GPT-5.5+ and GPT-6, an omitted effort is treated as active reasoning.-codexspecial-case from the name fallback; codex variants now follow their version's default.FieldTemperature,FieldTopLogprobs, andFieldLogprobsas typed constants inmodelcaps.go.Type of change
Affected areas
How to test
go test ./core/providers/openai/... ./core/schemas/...Key scenarios to validate:
gpt-6-astrawitheffort: "none"→ effort remapped to"low", all four sampling fields stripped.gpt-5.4with no effort set → sampling fields preserved (defaults to"none").gpt-5.5with no effort set → sampling fields stripped (defaults to"medium").gpt-5.6witheffort: "none"→ sampling fields preserved.o3witheffort: "high"→ sampling fields stripped.openai/gpt-oss-120b→temperaturepreserved regardless of effort.Params.Includeslice is not mutated whenlogprobsis stripped from the Responses request.Breaking changes
Security considerations
None. Changes are limited to request shaping before forwarding to upstream APIs; no auth, secrets, or PII are involved.
Checklist
docs/contributing/README.mdand followed the guidelines