From d885b81f2389c520a2f8d3ab72bad8a1655e1fea Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Tue, 3 Feb 2026 21:49:30 +0800 Subject: [PATCH] Fixed: #1403 fix(translator): handle "input" field transformation for OpenAI responses --- .../openai/responses/codex_openai-responses_request.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/translator/codex/openai/responses/codex_openai-responses_request.go b/internal/translator/codex/openai/responses/codex_openai-responses_request.go index 389c6d31..868b6422 100644 --- a/internal/translator/codex/openai/responses/codex_openai-responses_request.go +++ b/internal/translator/codex/openai/responses/codex_openai-responses_request.go @@ -11,6 +11,12 @@ import ( func ConvertOpenAIResponsesRequestToCodex(modelName string, inputRawJSON []byte, _ bool) []byte { rawJSON := bytes.Clone(inputRawJSON) + inputResult := gjson.GetBytes(rawJSON, "input") + if inputResult.Type == gjson.String { + input, _ := sjson.Set(`[{"type":"message","role":"user","content":[{"type":"input_text","text":""}]}]`, "0.content.0.text", inputResult.String()) + rawJSON, _ = sjson.SetRawBytes(rawJSON, "input", []byte(input)) + } + rawJSON, _ = sjson.SetBytes(rawJSON, "stream", true) rawJSON, _ = sjson.SetBytes(rawJSON, "store", false) rawJSON, _ = sjson.SetBytes(rawJSON, "parallel_tool_calls", true)