From 055494c390e7da67f46e06b869def76d485e142e Mon Sep 17 00:00:00 2001 From: wenjie Date: Wed, 11 Mar 2026 19:06:01 +0800 Subject: [PATCH] test(web): allow local oversized payload fixture --- pkg/tools/web_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/tools/web_test.go b/pkg/tools/web_test.go index 77afb9325..0737d2087 100644 --- a/pkg/tools/web_test.go +++ b/pkg/tools/web_test.go @@ -212,6 +212,8 @@ func TestWebTool_WebFetch_Truncation(t *testing.T) { } func TestWebFetchTool_PayloadTooLarge(t *testing.T) { + withPrivateWebFetchHostsAllowed(t) + // Create a mock HTTP server ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") @@ -434,7 +436,8 @@ func TestWebTool_WebFetch_PrivateHostBlocked(t *testing.T) { if !result.IsError { t.Errorf("expected error for private host URL, got success") } - if !strings.Contains(result.ForLLM, "private or local network") && !strings.Contains(result.ForUser, "private or local network") { + if !strings.Contains(result.ForLLM, "private or local network") && + !strings.Contains(result.ForUser, "private or local network") { t.Errorf("expected private host block message, got %q", result.ForLLM) } }