diff --git a/coderd/x/chatd/chatd_test.go b/coderd/x/chatd/chatd_test.go index 4d7d31629b3e8..7accb04b4649b 100644 --- a/coderd/x/chatd/chatd_test.go +++ b/coderd/x/chatd/chatd_test.go @@ -6343,7 +6343,6 @@ func TestActiveServer_BasicAssistantGenerationAndPromptPreparation(t *testing.T) require.GreaterOrEqual(t, last.RuntimeMs.Int64, int64(0)) requireTextPart(t, last, "done") - requests = newAnthropicRequestRecorder() server = newActiveTestServer(t, db, ps, func(cfg *chatd.Config) { cfg.AIBridgeTransportFactory = chatAIGatewayTransportFactoryPointer(chattest.NewMockAIBridgeTransport(t, anthropicURL, chattest.WithPreservePath())) }) @@ -6358,9 +6357,10 @@ func TestActiveServer_BasicAssistantGenerationAndPromptPreparation(t *testing.T) require.NoError(t, err) waitForChatStatus(ctx, t, db, planChat.ID, database.ChatStatusWaiting) - planRequests := filterAnthropicStreamingRequests(requests.all()) - require.Len(t, planRequests, 1) - toolNames = anthropicRequestToolNames(planRequests[0]) + allGenerationRequests := filterAnthropicStreamingRequests(requests.all()) + require.Len(t, allGenerationRequests, len(generationRequests)+1) + planRequest := allGenerationRequests[len(generationRequests)] + toolNames = anthropicRequestToolNames(planRequest) require.Contains(t, toolNames, "read_file") require.NotContains(t, toolNames, "write_file") }