diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index 0a5e7b56f..9ff1df418 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -136,11 +136,15 @@ func TestDefaultConfig_WebTools(t *testing.T) { cfg := DefaultConfig() // Verify web tools defaults - if cfg.Tools.Web.Search.MaxResults != 5 { - t.Error("Expected MaxResults 5, got ", cfg.Tools.Web.Search.MaxResults) + if cfg.Tools.Web.Brave.MaxResults != 5 { + t.Error("Expected Brave MaxResults 5, got ", cfg.Tools.Web.Brave.MaxResults) } - if cfg.Tools.Web.Search.APIKey != "" { - t.Error("Search API key should be empty by default") + if cfg.Tools.Web.Brave.APIKey != "" { + t.Error("Brave API key should be empty by default") + } + + if cfg.Tools.Web.DuckDuckGo.MaxResults != 5 { + t.Error("Expected DuckDuckGo MaxResults 5, got ", cfg.Tools.Web.DuckDuckGo.MaxResults) } } diff --git a/pkg/tools/web_test.go b/pkg/tools/web_test.go index 30bc7d991..c7753423e 100644 --- a/pkg/tools/web_test.go +++ b/pkg/tools/web_test.go @@ -175,7 +175,10 @@ func TestWebTool_WebFetch_Truncation(t *testing.T) { // TestWebTool_WebSearch_NoApiKey verifies error handling when API key is missing func TestWebTool_WebSearch_NoApiKey(t *testing.T) { - tool := NewWebSearchTool("", 5) + tool := NewWebSearchTool(WebSearchToolOptions{ + BraveAPIKey: "", // no api key test + BraveMaxResults: 5, + }) ctx := context.Background() args := map[string]interface{}{ "query": "test", @@ -196,7 +199,10 @@ func TestWebTool_WebSearch_NoApiKey(t *testing.T) { // TestWebTool_WebSearch_MissingQuery verifies error handling for missing query func TestWebTool_WebSearch_MissingQuery(t *testing.T) { - tool := NewWebSearchTool("test-key", 5) + tool := NewWebSearchTool(WebSearchToolOptions{ + BraveAPIKey: "test-key", // no api key test + BraveMaxResults: 5, + }) ctx := context.Background() args := map[string]interface{}{}