From 3ba5e1abc983038de0a0bf7bba3fb075d7f59cbf Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Mon, 15 Dec 2025 19:02:31 +0900 Subject: [PATCH] Add date/time context to Librarian agent, emphasize NOT 2024 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - librarian.ts: Add 'CRITICAL: DATE AWARENESS' section warning against 2024 searches - librarian.ts: Update examples to use 2025 instead of 2024 - utils.ts: Add librarian agent to envContext receiver list alongside OmO 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/agents/librarian.ts | 12 ++++++++++-- src/agents/utils.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/agents/librarian.ts b/src/agents/librarian.ts index de3c5a0..d22bb6a 100644 --- a/src/agents/librarian.ts +++ b/src/agents/librarian.ts @@ -13,6 +13,14 @@ You are **THE LIBRARIAN**, a specialized open-source codebase understanding agen Your job: Answer questions about open-source libraries by finding **EVIDENCE** with **GitHub permalinks**. +## CRITICAL: DATE AWARENESS + +**CURRENT YEAR CHECK**: Before ANY search, verify the current date from environment context. +- **NEVER search for 2024** - It is NOT 2024 anymore +- **ALWAYS use current year** (2025+) in search queries +- When searching: use "library-name topic 2025" NOT "2024" +- Filter out outdated 2024 results when they conflict with 2025 information + --- ## PHASE 0: REQUEST CLASSIFICATION (MANDATORY FIRST STEP) @@ -37,7 +45,7 @@ Classify EVERY request into one of these categories before taking action: \`\`\` Tool 1: context7_resolve-library-id("library-name") → then context7_get-library-docs(id, topic: "specific-topic") -Tool 2: websearch_exa_web_search_exa("library-name topic 2024/2025") +Tool 2: websearch_exa_web_search_exa("library-name topic 2025") Tool 3: grep_app_searchGitHub(query: "usage pattern", language: ["TypeScript"]) \`\`\` @@ -160,7 +168,7 @@ https://github.com/tanstack/query/blob/abc123def/packages/react-query/src/useQue | Purpose | Tool | Command/Usage | |---------|------|---------------| | **Official Docs** | context7 | \`context7_resolve-library-id\` → \`context7_get-library-docs\` | -| **Latest Info** | websearch_exa | \`websearch_exa_web_search_exa("query 2024")\` | +| **Latest Info** | websearch_exa | \`websearch_exa_web_search_exa("query 2025")\` | | **Fast Code Search** | grep_app | \`grep_app_searchGitHub(query, language, useRegexp)\` | | **Deep Code Search** | gh CLI | \`gh search code "query" --repo owner/repo\` | | **Clone Repo** | gh CLI | \`gh repo clone owner/repo \${TMPDIR:-/tmp}/name -- --depth 1\` | diff --git a/src/agents/utils.ts b/src/agents/utils.ts index af3f5ee..d33a276 100644 --- a/src/agents/utils.ts +++ b/src/agents/utils.ts @@ -75,7 +75,7 @@ export function createBuiltinAgents( let finalConfig = config - if (agentName === "OmO" && directory && config.prompt) { + if ((agentName === "OmO" || agentName === "librarian") && directory && config.prompt) { const envContext = createEnvContext(directory) finalConfig = { ...config,