From 0b94d36c4a8fc25f3536ed2f98aa5b9adeefa37d Mon Sep 17 00:00:00 2001 From: Muran-prog Date: Sat, 14 Mar 2026 21:45:28 +0200 Subject: [PATCH] test: use exact match for tool name assertion Address review feedback - drop function.name fallback and strings.Contains in favor of direct == comparison. --- .../openai/chat-completions/codex_openai_request_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go b/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go index 9ce52e59..84c8dad2 100644 --- a/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go +++ b/internal/translator/codex/openai/chat-completions/codex_openai_request_test.go @@ -1,7 +1,6 @@ package chat_completions import ( - "strings" "testing" "github.com/tidwall/gjson" @@ -623,14 +622,9 @@ func TestToolsDefinitionTranslated(t *testing.T) { t.Fatal("no tools found in output") } - // look for "search" tool found := false for _, tool := range tools { - name := tool.Get("name").String() - if name == "" { - name = tool.Get("function.name").String() - } - if strings.Contains(name, "search") { + if tool.Get("name").String() == "search" { found = true break }