Allow GPT-5 temperature with reasoning none#941
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 70a68fffe9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
| const canKeepTemperature = | ||
| typeof bodyData?.model === "string" && | ||
| bodyData.model.toLowerCase().includes("gpt-5") && | ||
| Object.prototype.hasOwnProperty.call(bodyData, "reasoning_effort") && | ||
| bodyData.reasoning_effort === "none"; |
There was a problem hiding this comment.
Move request-shaping fix to gateway
This repository is the deprecated proxy, and /workspace/braintrust-proxy/AGENTS.md says model routing, provider translation, and request/response shaping fixes belong in ../gateway/ with only model_list.json changes valid here. This change alters OpenAI request shaping in proxy.ts, so it updates deprecated proxy code/tests instead of the gateway path that should receive this behavior.
Useful? React with 👍 / 👎.
Context
PR #16823 updates api-ts to preserve temperature for GPT-5 prompts when reasoning_effort is explicitly set to "none". The proxy was still stripping temperature for GPT-5/reasoning-model requests before forwarding them, so proxied OpenAI-format requests would not get the benefit of that fix.
Changes
Update the OpenAI proxy path to preserve temperature for GPT-5 requests when reasoning_effort === "none", while continuing to remove temperature for GPT-5 requests where reasoning is still enabled. This is implemented by adding a canKeepTemperature check in repos/braintrust-proxy/packages/proxy/src/proxy.ts:2370 and only deleting temperature when that condition is false.
Testing
Add coverage in repos/braintrust-proxy/packages/proxy/src/providers/openai.test.ts:371 for both cases: