fix(web): send fetched content to LLM instead of summary metadata

web_fetch was returning only a short metadata string to the LLM
("Fetched N bytes from ..."), so the model never saw the actual page
content and fell back to hallucinated answers. Now ForLLM carries the
full JSON payload (url, status, text) so the model reasons on real
fetched data.
This commit is contained in:
michal 2026-02-20 07:41:59 +01:00
parent 56a060ff61
commit 137cf94878

View file

@ -477,7 +477,7 @@ func (t *WebFetchTool) Execute(ctx context.Context, args map[string]interface{})
resultJSON, _ := json.MarshalIndent(result, "", " ") resultJSON, _ := json.MarshalIndent(result, "", " ")
return &ToolResult{ return &ToolResult{
ForLLM: fmt.Sprintf("Fetched %d bytes from %s (extractor: %s, truncated: %v)", len(text), urlStr, extractor, truncated), ForLLM: string(resultJSON),
ForUser: string(resultJSON), ForUser: string(resultJSON),
} }
} }