fix: remove double-registration of shell tools in engine builder

The second feature-flag gate in tool_setup.rs was calling
with_shell_tools() again when allow_shell was already true, causing
duplicate tool registration. Remove the redundant gate since
with_agent_tools() already handles the allow_shell check.

Also add task_shell_wait to MODES.md alongside task_shell_start.
This commit is contained in:
Hu Qiantao
2026-05-31 12:18:31 +08:00
committed by Hunter Bown
parent ed81d13782
commit c6cec29f63
2 changed files with 4 additions and 9 deletions
+3 -8
View File
@@ -79,14 +79,9 @@ impl Engine {
if self.config.features.enabled(Feature::WebSearch) {
builder = builder.with_web_tools();
}
// Plan mode is strictly read-only: do not expose shell execution at
// all, even if the session would otherwise allow it.
if mode != AppMode::Plan
&& self.config.features.enabled(Feature::ShellTool)
&& self.session.allow_shell
{
builder = builder.with_shell_tools().with_runtime_task_shell_tools();
}
// Shell tools (exec_shell, task_shell_start, etc.) are already gated
// behind `allow_shell` inside `with_agent_tools`. No separate
// feature-flag gate here to avoid double-registration.
// Register the `remember` tool only when the user has opted in to
// user-memory (#489). Without that opt-in the tool would always
+1 -1
View File
@@ -19,7 +19,7 @@ Run `/mode` to open the mode picker, or switch directly with `/mode agent`,
`/mode plan`, `/mode yolo`, `/mode 1`, `/mode 2`, or `/mode 3`.
- **Plan**: design-first prompting. Read-only investigation tools stay available; shell and patch execution stay off. Use this when you want to think out loud and produce a plan to hand to a human (yourself later, or a reviewer).
- **Agent**: multi-step tool use. Shell execution (`exec_shell`, `task_shell_start`) requires `allow_shell = true` in config; approval prompts gate each call. File writes are allowed without a prompt.
- **Agent**: multi-step tool use. Shell execution (`exec_shell`, `task_shell_start`, `task_shell_wait`) requires `allow_shell = true` in config; approval prompts gate each call. File writes are allowed without a prompt.
- **YOLO**: enables shell + trust mode and auto-approves all tools. Use only in trusted repos.
All action-capable modes have access to persistent RLM sessions through `rlm_open`, `rlm_eval`, `rlm_configure`, and `rlm_close`. Inside an RLM Python REPL, `sub_query_batch` fans out 1-16 cheap parallel child calls pinned to `deepseek-v4-flash`. The model reaches for it when work is too large or repetitive for the parent transcript.