feat(mcp): restrict grep_app tools to librarian agent only (#395)
* feat(mcp): restrict grep_app tools to librarian agent only Reduces token usage by disabling grep_app MCP tools globally and enabling them only for the librarian agent, which uses them for GitHub code search during documentation lookups. Changes: - Add grep_app_* tool disable globally in config.tools - Add grep_app_* tool enable for librarian agent - Remove grep_app references from explore agent prompt (no access) Closes #394 * chore: changes by sisyphus-dev-ai --------- Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
This commit is contained in:
@@ -64,7 +64,8 @@
|
|||||||
"ralph-loop",
|
"ralph-loop",
|
||||||
"preemptive-compaction",
|
"preemptive-compaction",
|
||||||
"compaction-context-injector",
|
"compaction-context-injector",
|
||||||
"claude-code-hooks"
|
"claude-code-hooks",
|
||||||
|
"auto-slash-command"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -108,18 +108,8 @@ Use the right tool for the job:
|
|||||||
- **Text patterns** (strings, comments, logs): grep
|
- **Text patterns** (strings, comments, logs): grep
|
||||||
- **File patterns** (find by name/extension): glob
|
- **File patterns** (find by name/extension): glob
|
||||||
- **History/evolution** (when added, who changed): git commands
|
- **History/evolution** (when added, who changed): git commands
|
||||||
- **External examples** (how others implement): grep_app
|
|
||||||
|
|
||||||
### grep_app Strategy
|
Flood with parallel calls. Cross-validate findings across multiple tools.`,
|
||||||
|
|
||||||
grep_app searches millions of public GitHub repos instantly — use it for external patterns and examples.
|
|
||||||
|
|
||||||
**Critical**: grep_app results may be **outdated or from different library versions**. Always:
|
|
||||||
1. Start with grep_app for broad discovery
|
|
||||||
2. Launch multiple grep_app calls with query variations in parallel
|
|
||||||
3. **Cross-validate with local tools** (grep, ast_grep_search, LSP) before trusting results
|
|
||||||
|
|
||||||
Flood with parallel calls. Trust only cross-validated results.`,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -489,6 +489,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
|
|
||||||
config.tools = {
|
config.tools = {
|
||||||
...config.tools,
|
...config.tools,
|
||||||
|
"grep_app_*": false, // Disable grep_app tools globally to reduce token usage (only librarian needs them)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (config.agent.explore) {
|
if (config.agent.explore) {
|
||||||
@@ -501,6 +502,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
|||||||
config.agent.librarian.tools = {
|
config.agent.librarian.tools = {
|
||||||
...config.agent.librarian.tools,
|
...config.agent.librarian.tools,
|
||||||
call_omo_agent: false,
|
call_omo_agent: false,
|
||||||
|
"grep_app_*": true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (config.agent["multimodal-looker"]) {
|
if (config.agent["multimodal-looker"]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user