Unverified Commit 9450edf4 authored by Wesley Liddick's avatar Wesley Liddick Committed by GitHub
Browse files

Merge pull request #589 from 0-don/fix/strip-unsupported-codex-params

fix: strip unsupported parameters from Codex model requests
parents 785a7397 8ff40f52
...@@ -112,13 +112,19 @@ func applyCodexOAuthTransform(reqBody map[string]any, isCodexCLI bool) codexTran ...@@ -112,13 +112,19 @@ func applyCodexOAuthTransform(reqBody map[string]any, isCodexCLI bool) codexTran
result.Modified = true result.Modified = true
} }
if _, ok := reqBody["max_output_tokens"]; ok { // Strip parameters unsupported by codex models via the Responses API.
delete(reqBody, "max_output_tokens") for _, key := range []string{
result.Modified = true "max_output_tokens",
} "max_completion_tokens",
if _, ok := reqBody["max_completion_tokens"]; ok { "temperature",
delete(reqBody, "max_completion_tokens") "top_p",
result.Modified = true "frequency_penalty",
"presence_penalty",
} {
if _, ok := reqBody[key]; ok {
delete(reqBody, key)
result.Modified = true
}
} }
if normalizeCodexTools(reqBody) { if normalizeCodexTools(reqBody) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment