mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-08-24 02:14:13 -05:00
fix(codex-openai-proxy): strip unsupported user param
LibreChat injects a `user` field into the request body, but the Codex backend 400s with "Unsupported parameter: user". Drop it in shape_responses_body alongside the sampling params gpt-5 reasoning models already reject. Assisted-by: pi (claude-opus-4-8)
This commit is contained in:
@@ -145,9 +145,10 @@ def shape_responses_body(body: dict) -> dict:
|
||||
include = set(body.get("include") or [])
|
||||
include.add("reasoning.encrypted_content")
|
||||
body["include"] = sorted(include)
|
||||
# Sampling params gpt-5 reasoning models reject.
|
||||
# Params the Codex backend rejects: sampling knobs gpt-5 reasoning models
|
||||
# don't take, plus `user`, which LibreChat injects but the backend 400s on.
|
||||
for bad in ("temperature", "top_p", "max_tokens", "frequency_penalty",
|
||||
"presence_penalty"):
|
||||
"presence_penalty", "user"):
|
||||
body.pop(bad, None)
|
||||
return body
|
||||
|
||||
|
||||
Reference in New Issue
Block a user