From 6edacb4f7ea0a61e0d3de46371eb59c09f9a8c92 Mon Sep 17 00:00:00 2001 From: Luca Martinetti Date: Thu, 26 Feb 2026 19:56:28 +0000 Subject: [PATCH] fix: return fetched content to LLM in web_fetch tool WebFetchTool.Execute was setting ForLLM to a summary string ("Fetched N bytes from URL ...") instead of the actual extracted text. This meant the LLM never saw the page content and could not answer questions based on fetched web pages. Return the extracted text in ForLLM so the model can use it. Co-Authored-By: Claude Opus 4.6 --- pkg/tools/web.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/tools/web.go b/pkg/tools/web.go index 8ba2a723a..18ebe3cef 100644 --- a/pkg/tools/web.go +++ b/pkg/tools/web.go @@ -652,13 +652,7 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) *ToolRe resultJSON, _ := json.MarshalIndent(result, "", " ") return &ToolResult{ - ForLLM: fmt.Sprintf( - "Fetched %d bytes from %s (extractor: %s, truncated: %v)", - len(text), - urlStr, - extractor, - truncated, - ), + ForLLM: text, ForUser: string(resultJSON), } }