From 17b5c39d56d7050ed865988dc1cfebdceb522505 Mon Sep 17 00:00:00 2001 From: Lei Date: Sat, 28 Feb 2026 22:38:52 +0800 Subject: [PATCH] fix web_fetch --- pkg/tools/web.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pkg/tools/web.go b/pkg/tools/web.go index 8ba2a723a..355a0e88a 100644 --- a/pkg/tools/web.go +++ b/pkg/tools/web.go @@ -651,14 +651,17 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) *ToolRe resultJSON, _ := json.MarshalIndent(result, "", " ") + forLLM := fmt.Sprintf( + "Fetched %d bytes from %s (extractor: %s, truncated: %v)\nContent:\n%s", + len(text), + urlStr, + extractor, + truncated, + text + ), + return &ToolResult{ - ForLLM: fmt.Sprintf( - "Fetched %d bytes from %s (extractor: %s, truncated: %v)", - len(text), - urlStr, - extractor, - truncated, - ), + ForLLM: forLLM, ForUser: string(resultJSON), } }