From 1ee683cd81aa0682b153a4ffb4a9e22477fe6e1f Mon Sep 17 00:00:00 2001 From: xlx1212 Date: Fri, 7 Aug 2026 06:53:37 +0800 Subject: [PATCH] fix(agents): reduce Explore subagent overuse by strengthening prompt guidance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue #216: The Explore subagent was being triggered too frequently for simple, targeted queries where direct Grep/Glob/Read would be faster and more accurate. Add explicit guidance in both the agentic mode prompt and the Task tool description to reserve Explore for truly open-ended exploration — broad architectural questions, unfamiliar code areas, or multi-module tracing — and use direct tools for known symbols, specific files, and single search patterns. Changes: - agentic_mode.md: Add bullet under Tool usage policy clarifying when to use vs. not use the Explore subagent - task/schema.rs: Add bullet in Task tool 'When to use' section discouraging Explore for targeted lookups that a single Grep/Glob/Read can handle --- src/crates/assembly/agent-content/prompts/agents/agentic_mode.md | 1 + .../core/src/agentic/tools/implementations/task/schema.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/crates/assembly/agent-content/prompts/agents/agentic_mode.md b/src/crates/assembly/agent-content/prompts/agents/agentic_mode.md index 8311e884d8..fa65e1098f 100644 --- a/src/crates/assembly/agent-content/prompts/agents/agentic_mode.md +++ b/src/crates/assembly/agent-content/prompts/agents/agentic_mode.md @@ -88,6 +88,7 @@ The user will primarily request you perform software engineering tasks. This inc # Tool usage policy - Prefer the most direct tool path that preserves accuracy: use Read, Grep, and Glob for narrow lookups; use Task subagents for broad, multi-area, or independently delegable work. +- Reserve the Explore subagent for truly open-ended exploration — broad architectural questions, unfamiliar code areas, or tracing across many modules. For targeted queries (known symbols, specific files, single search patterns), use Grep, Glob, and Read directly. Spawning Explore for simple lookups adds latency without improving results. - When the user explicitly asks to complete work and review it carefully, finish the implementation first, then dispatch one independent read-only `CodeReview` Task. Do not run concurrent review tasks or fan out `CodeReview` into architecture, performance, security, product, or other invented dimensions: broader coverage belongs to the unified `/review` path, which selects bounded review lenses and owns cost confirmation. Do not launch review by default for every task. - Treat reviewer output as adversarial evidence. The reviewer never fixes its own findings. Apply accepted fixes in the implementation agent. If substantive fixes make the original verdict stale and the risk warrants another pass, request at most one fresh independent re-review. - When WebFetch reports a redirect, follow the redirect URL if it is relevant and safe for the user's request. diff --git a/src/crates/assembly/core/src/agentic/tools/implementations/task/schema.rs b/src/crates/assembly/core/src/agentic/tools/implementations/task/schema.rs index 9b31f3e809..f0fac69f3b 100644 --- a/src/crates/assembly/core/src/agentic/tools/implementations/task/schema.rs +++ b/src/crates/assembly/core/src/agentic/tools/implementations/task/schema.rs @@ -86,6 +86,7 @@ impl TaskTool { When to use: - Delegate when a specialized subagent or separate context is likely to improve coverage, independence, or parallelism. - Use direct tools instead for focused lookups, known paths, single symbols, or code that can be inspected with a few reads or searches. +- The Explore subagent is for broad, open-ended codebase exploration. Do not spawn it for targeted lookups that a single Grep, Glob, or Read can handle — that adds latency without improving results. Supported actions: - `spawn`: create and run a new subagent. The result contains an `agent_id` for future `send_input` or `cancel`.