fix(codex): normalize small output budgets for all source formats

- Raise positive integer max_output_tokens below 16 to the Codex minimum on the translated payload across HTTP and WebSocket paths, before user payload rules.
- Send inference verification with a 16-token budget so healthy Codex OAuth credentials are no longer rejected by the upstream minimum.
- Add regression coverage for VerifyInference and small budgets from every Codex source format.

Closes: #7304
This commit is contained in:
Luis Pater
2026-11-07 01:57:41 +08:00
parent 68cd75724e
commit bfac85864c
10 changed files with 274 additions and 29 deletions

View File

@@ -58,7 +58,7 @@ func (e *CodexExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re
}
originalTranslated = helps.SetStringIfDifferent(originalTranslated, "model", baseModel)
doc := ojson.NewDoc(body)
normalizeCodexClaudeOutputBudgetDoc(doc, from, req.Payload)
normalizeCodexOutputBudgetDoc(doc)
helps.SetStringIfDifferentDoc(doc, "model", baseModel)
if err = helps.ApplyRequestThinkingDoc(doc, req, opts, from.String(), to.String(), e.Identifier(), updatesChanged); err != nil {