From 771169e32f3b02f65d1e2704755640247119b16d Mon Sep 17 00:00:00 2001 From: mqyang56 Date: Thu, 26 Feb 2026 10:12:33 +0800 Subject: [PATCH] fix: inject current date into WebSearchTool description Make WebSearchTool.Description() dynamic so the LLM sees today's date exactly at the point where it constructs search queries. Previously, the static description caused the model to default to its training-cutoff year for time-relative queries (e.g. "yesterday's AI news"). Fixes #754 --- pkg/tools/web.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tools/web.go b/pkg/tools/web.go index 44df28215..a92afe518 100644 --- a/pkg/tools/web.go +++ b/pkg/tools/web.go @@ -449,7 +449,7 @@ func (t *WebSearchTool) Name() string { } func (t *WebSearchTool) Description() string { - return "Search the web for current information. Returns titles, URLs, and snippets from search results." + return fmt.Sprintf("Search the web for current information. Returns titles, URLs, and snippets from search results. Today's date is %s. When constructing queries about recent events, use this date as reference.", time.Now().Format("2006-01-02")) } func (t *WebSearchTool) Parameters() map[string]any {