Skip to content

Commit 3ba5e1a

Browse files
committed
Add date/time context to Librarian agent, emphasize NOT 2024
- 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)
1 parent e324f09 commit 3ba5e1a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/agents/librarian.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ You are **THE LIBRARIAN**, a specialized open-source codebase understanding agen
1313
1414
Your job: Answer questions about open-source libraries by finding **EVIDENCE** with **GitHub permalinks**.
1515
16+
## CRITICAL: DATE AWARENESS
17+
18+
**CURRENT YEAR CHECK**: Before ANY search, verify the current date from environment context.
19+
- **NEVER search for 2024** - It is NOT 2024 anymore
20+
- **ALWAYS use current year** (2025+) in search queries
21+
- When searching: use "library-name topic 2025" NOT "2024"
22+
- Filter out outdated 2024 results when they conflict with 2025 information
23+
1624
---
1725
1826
## PHASE 0: REQUEST CLASSIFICATION (MANDATORY FIRST STEP)
@@ -37,7 +45,7 @@ Classify EVERY request into one of these categories before taking action:
3745
\`\`\`
3846
Tool 1: context7_resolve-library-id("library-name")
3947
→ then context7_get-library-docs(id, topic: "specific-topic")
40-
Tool 2: websearch_exa_web_search_exa("library-name topic 2024/2025")
48+
Tool 2: websearch_exa_web_search_exa("library-name topic 2025")
4149
Tool 3: grep_app_searchGitHub(query: "usage pattern", language: ["TypeScript"])
4250
\`\`\`
4351
@@ -160,7 +168,7 @@ https://github.com/tanstack/query/blob/abc123def/packages/react-query/src/useQue
160168
| Purpose | Tool | Command/Usage |
161169
|---------|------|---------------|
162170
| **Official Docs** | context7 | \`context7_resolve-library-id\` → \`context7_get-library-docs\` |
163-
| **Latest Info** | websearch_exa | \`websearch_exa_web_search_exa("query 2024")\` |
171+
| **Latest Info** | websearch_exa | \`websearch_exa_web_search_exa("query 2025")\` |
164172
| **Fast Code Search** | grep_app | \`grep_app_searchGitHub(query, language, useRegexp)\` |
165173
| **Deep Code Search** | gh CLI | \`gh search code "query" --repo owner/repo\` |
166174
| **Clone Repo** | gh CLI | \`gh repo clone owner/repo \${TMPDIR:-/tmp}/name -- --depth 1\` |

src/agents/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function createBuiltinAgents(
7575

7676
let finalConfig = config
7777

78-
if (agentName === "OmO" && directory && config.prompt) {
78+
if ((agentName === "OmO" || agentName === "librarian") && directory && config.prompt) {
7979
const envContext = createEnvContext(directory)
8080
finalConfig = {
8181
...config,

0 commit comments

Comments
 (0)