GeezerVison is showing github.com — fix: tweak websearch tool description date info to avoid cache busts … · starascendin/opencode@daf564b
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/opencode/src/tool
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/websearch.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -40,7 +40,7 @@ interface McpSearchResponse { |
40 | 40 | export const WebSearchTool = Tool.define("websearch", async () => { |
41 | 41 | return { |
42 | 42 | get description() { |
43 | | - return DESCRIPTION.replace("{{date}}", new Date().toISOString().slice(0, 10)) |
| 43 | + return DESCRIPTION.replace("{{year}}", new Date().getFullYear().toString()) |
44 | 44 | }, |
45 | 45 | parameters: z.object({ |
46 | 46 | query: z.string().describe("Websearch query"), |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/websearch.txt +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,5 +10,5 @@ Usage notes: |
10 | 10 | - Configurable context length for optimal LLM integration |
11 | 11 | - Domain filtering and advanced search options available |
12 | 12 |
|
13 | | -Today's date is {{date}}. You MUST use this year when searching for recent information or current events |
14 | | -- Example: If today is 2025-07-15 and the user asks for "latest AI news", search for "AI news 2025", NOT "AI news 2024" |
| 13 | +The current year is {{year}}. You MUST use this year when searching for recent information or current events |
| 14 | +- Example: If the current year is 2026 and the user asks for "latest AI news", search for "AI news 2026", NOT "AI news 2025" |