Merge pull request #2068 from Ogannesson/fix/openai-drop-reasoning-items-from-input

fix(openai): drop reasoning items from /v1/responses input on OAuth path
This commit is contained in:
Wesley Liddick
2026-04-29 21:32:52 +08:00
committed by GitHub
2 changed files with 61 additions and 0 deletions

View File

@@ -907,6 +907,14 @@ func filterCodexInput(input []any, preserveReferences bool) []any {
}
typ, _ := m["type"].(string)
// chatgpt.com codex backend (OAuth path) does not persist reasoning
// items because applyCodexOAuthTransform forces store=false. Any rs_*
// reference replayed in input is guaranteed to 404 upstream
// ("Item with id 'rs_...' not found"). Drop reasoning items entirely.
if typ == "reasoning" {
continue
}
// 仅修正真正的 tool/function call 标识,避免误改普通 message/reasoning id
// 若 item_reference 指向 legacy call_* 标识,则仅修正该引用本身。
fixCallIDPrefix := func(id string) string {