fix: system prompt — all 30 tools + cost awareness + debug/browser guidance#58
fix: system prompt — all 30 tools + cost awareness + debug/browser guidance#58kienbui1995 merged 1 commit intomainfrom
Conversation
Before: only 12/30 tools described in system prompt After: all 30 tools organized in 5 categories Added sections: - Core Tools (9): bash, read/write/edit_file, batch_edit, apply_patch, glob/grep/codebase_search - Planning & Delegation (6): edit_plan, subagent, task_*, todo_write - Debugging & Testing (3): debug, browser, lsp_query - Context & Memory (5): memory_*, web_*, ask_user - Workspace (5): worktree_*, notebook_edit, sleep, mcp_* New guidance: - Cost Awareness: prefer codebase_search, use edit over write, delegate cheap tasks - When to use debug tool (systematic investigation) - When to use browser tool (web UI verification) - When to use ask_user (ambiguous requirements) 274 tests, 0 fail.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe assistant system prompt has been restructured to reorganize tool descriptions into thematic sections (Planning & Delegation, Debugging & Testing, Context & Memory, Workspace), introduce new tools (batch_edit, apply_patch, task_create, debug, browser, etc.), and update tool usage guidelines to reference batch_edit for multiple edits and prefer debug/ask_user for error recovery. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Code Review
This pull request significantly expands the system prompt for the AI agent, introducing new tool categories such as Planning & Delegation, Debugging & Testing, and Workspace management. It also adds sections for cost awareness and refined tool usage guidelines. However, multiple tools advertised in the updated prompt—specifically lsp_query, ask_user, notebook_edit, sleep, and the MCP resource tools—lack the necessary backend implementations in the registry or dispatcher, which will cause the agent to attempt non-existent tool calls.
| ## Debugging & Testing\n\ | ||
| - `debug`: Structured debugging — generate hypotheses, instrument code, analyze evidence, apply targeted fix. Use when standard approaches fail.\n\ | ||
| - `browser`: Control a headless browser (navigate, screenshot, click, type, evaluate JS). Use to test web UIs or verify frontend changes.\n\ | ||
| - `lsp_query`: Query the Language Server for diagnostics, definitions, references. Use for type errors and navigation.\n\n\ |
There was a problem hiding this comment.
The lsp_query tool is described in the system prompt, but it appears to be missing from the tool execution dispatcher. While it is present in mc-tools/src/registry.rs's validate_input function (lines 386-389), it is not handled in the execute_inner match arms. This will cause the agent to attempt calls that fail with a "not found" error.
| - `web_fetch`: Fetch content from a URL. Use to read documentation or API specs.\n\ | ||
| - `web_search`: Search the web for current information.\n\ | ||
| - `memory_read`/`memory_write`: Read/write persistent project facts across sessions.\n\n\ | ||
| - `ask_user`: Ask the user a clarifying question when requirements are ambiguous.\n\n\ |
| - `notebook_edit`: Edit Jupyter notebook cells.\n\ | ||
| - `sleep`: Wait for a specified duration (use with background tasks).\n\ | ||
| - `mcp_list_resources`/`mcp_read_resource`: Access external tools via MCP servers.\n\n\ |
There was a problem hiding this comment.
The tools notebook_edit, sleep, mcp_list_resources, and mcp_read_resource are described in the system prompt but are not implemented in either runtime.rs or registry.rs. Adding them to the prompt without implementation will cause the agent to hallucinate tool calls that fail. Additionally, the mcp_ prefix handling in registry.rs (lines 339-348) expects a mcp_{server}_{tool} format, which mcp_list_resources does not follow.
Re: Gemini Code Assist Review
This is incorrect. All 30 tools have backend implementations:
Verification: No changes needed. |
Problem
System prompt only described 12/30 tools. Agent didn't know about browser, debug, batch_edit, tasks, worktree, MCP, etc.
Fix
All 30 tools now described, organized in 5 categories:
New guidance sections:
274 tests, 0 fail.
Summary by CodeRabbit
Release Notes
New Features
Documentation