@@ -442,9 +442,9 @@ func TestOpenAIChatCompletions(t *testing.T) {
442442
443443 require .Len (t , recorderClient .toolUsages , 1 )
444444 assert .Equal (t , "read_file" , recorderClient .toolUsages [0 ].Tool )
445- require .IsType (t , map [ string ] any {} , recorderClient .toolUsages [0 ].Args )
445+ require .IsType (t , "" , recorderClient .toolUsages [0 ].Args )
446446 require .Contains (t , recorderClient .toolUsages [0 ].Args , "path" )
447- assert .Equal (t , "README.md" , recorderClient .toolUsages [0 ].Args .(map [ string ] any )[ "path" ] )
447+ assert .Equal (t , "README.md" , gjson . Get ( recorderClient .toolUsages [0 ].Args .(string ), "path" ). Str )
448448
449449 require .Len (t , recorderClient .userPrompts , 1 )
450450 assert .Equal (t , "how large is the README.md file in my current path" , recorderClient .userPrompts [0 ].Prompt )
@@ -765,7 +765,7 @@ func TestAnthropicInjectedTools(t *testing.T) {
765765 }
766766
767767 // Build the requirements & make the assertions which are common to all providers.
768- recorderClient , resp := setupInjectedToolTest (t , antSingleInjectedTool , streaming , configureFn , createAnthropicMessagesReq )
768+ recorderClient , _ , resp := setupInjectedToolTest (t , antSingleInjectedTool , streaming , configureFn , createAnthropicMessagesReq )
769769
770770 // Ensure expected tool was invoked with expected input.
771771 require .Len (t , recorderClient .toolUsages , 1 )
@@ -847,16 +847,13 @@ func TestOpenAIInjectedTools(t *testing.T) {
847847 }
848848
849849 // Build the requirements & make the assertions which are common to all providers.
850- recorderClient , resp := setupInjectedToolTest (t , oaiSingleInjectedTool , streaming , configureFn , createOpenAIChatCompletionsReq )
850+ recorderClient , _ , resp := setupInjectedToolTest (t , oaiSingleInjectedTool , streaming , configureFn , createOpenAIChatCompletionsReq )
851851
852852 // Ensure expected tool was invoked with expected input.
853853 require .Len (t , recorderClient .toolUsages , 1 )
854854 require .Equal (t , mockToolName , recorderClient .toolUsages [0 ].Tool )
855- expected , err := json .Marshal (map [string ]any {"owner" : "admin" })
856- require .NoError (t , err )
857- actual , err := json .Marshal (recorderClient .toolUsages [0 ].Args )
858- require .NoError (t , err )
859- require .EqualValues (t , expected , actual )
855+ expected := "{\" owner\" :\" admin\" }"
856+ require .EqualValues (t , expected , recorderClient .toolUsages [0 ].Args )
860857
861858 var (
862859 content * openai.ChatCompletionChoice
@@ -932,7 +929,7 @@ func TestOpenAIInjectedTools(t *testing.T) {
932929
933930// setupInjectedToolTest abstracts the common aspects required for the Test*InjectedTools tests.
934931// Kinda fugly right now, we can refactor this later.
935- func setupInjectedToolTest (t * testing.T , fixture []byte , streaming bool , configureFn func (addr string , client aibridge.Recorder , srvProxyMgr * mcp.ServerProxyManager ) (* aibridge.RequestBridge , error ), createRequestFn func (* testing.T , string , []byte ) * http.Request ) (* mockRecorderClient , * http.Response ) {
932+ func setupInjectedToolTest (t * testing.T , fixture []byte , streaming bool , configureFn func (addr string , client aibridge.Recorder , srvProxyMgr * mcp.ServerProxyManager ) (* aibridge.RequestBridge , error ), createRequestFn func (* testing.T , string , []byte ) * http.Request ) (* mockRecorderClient , map [ string ]mcp. ServerProxier , * http.Response ) {
936933 t .Helper ()
937934
938935 arc := txtar .Parse (fixture )
@@ -1008,7 +1005,7 @@ func setupInjectedToolTest(t *testing.T, fixture []byte, streaming bool, configu
10081005 return mockSrv .callCount .Load () == 2
10091006 }, time .Second * 10 , time .Millisecond * 50 )
10101007
1011- return recorderClient , resp
1008+ return recorderClient , tools , resp
10121009}
10131010
10141011func TestErrorHandling (t * testing.T ) {
0 commit comments