From 2533df1df967189d0ecf134beed608d0883763f9 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Tue, 6 Jan 2026 17:34:36 -0800 Subject: [PATCH] fix: allow read-only subagents (explore, plan, recall) in plan mode (#481) Co-authored-by: Letta --- src/permissions/mode.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/permissions/mode.ts b/src/permissions/mode.ts index 2290392..654859a 100644 --- a/src/permissions/mode.ts +++ b/src/permissions/mode.ts @@ -197,6 +197,23 @@ class PermissionModeManager { } } + // Allow Task tool with read-only subagent types + // These subagents only have access to read-only tools (Glob, Grep, Read, LS, BashOutput) + const readOnlySubagentTypes = new Set([ + "explore", + "Explore", + "plan", + "Plan", + "recall", + "Recall", + ]); + if (toolName === "Task" || toolName === "task") { + const subagentType = toolArgs?.subagent_type as string | undefined; + if (subagentType && readOnlySubagentTypes.has(subagentType)) { + return "allow"; + } + } + // Allow read-only shell commands (ls, git status, git log, etc.) const shellTools = [ "Bash",