Skip to content

Commit 179c407

Browse files
authored
fix: tweak websearch tool description date info to avoid cache busts (anomalyco#13559)
1 parent 1e25df2 commit 179c407

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/opencode/src/tool/websearch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface McpSearchResponse {
4040
export const WebSearchTool = Tool.define("websearch", async () => {
4141
return {
4242
get description() {
43-
return DESCRIPTION.replace("{{date}}", new Date().toISOString().slice(0, 10))
43+
return DESCRIPTION.replace("{{year}}", new Date().getFullYear().toString())
4444
},
4545
parameters: z.object({
4646
query: z.string().describe("Websearch query"),

packages/opencode/src/tool/websearch.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Usage notes:
1010
- Configurable context length for optimal LLM integration
1111
- Domain filtering and advanced search options available
1212

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"

0 commit comments

Comments
 (0)