diff --git a/internal/translator/codex/claude/codex_claude_request.go b/internal/translator/codex/claude/codex_claude_request.go index 8036d5d5..21d47f41 100644 --- a/internal/translator/codex/claude/codex_claude_request.go +++ b/internal/translator/codex/claude/codex_claude_request.go @@ -186,6 +186,12 @@ func ConvertClaudeRequestToCodex(modelName string, inputRawJSON []byte, _ bool) shortMap := buildShortNameMap(names) for i := 0; i < len(toolResults); i++ { toolResult := toolResults[i] + // Special handling: map Claude web search tool to Codex web_search + if toolResult.Get("type").String() == "web_search_20250305" { + // Replace the tool content entirely with {"type":"web_search"} + template, _ = sjson.SetRaw(template, "tools.-1", `{"type":"web_search"}`) + continue + } tool := toolResult.Raw tool, _ = sjson.Set(tool, "type", "function") // Apply shortened name if needed