From 203c647e4c5ee8994cae0e6551d6d8e4d779d1a0 Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Sun, 2 Aug 2026 13:51:17 -0400 Subject: [PATCH 1/4] fix: exclude 'execute' tool from sub-agent tool set The 'execute' tool is provided by SandboxBackendProtocolV2 via the core backend (LocalShellBackend). Sub-agents inherit the backend and can see it, but it should only be available to the orchestrator. Register a harness profile that excludes 'execute' (and write_todos) from sub-agent tool sets via the createToolExclusionMiddleware. --- src/agent/deepAgents.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/agent/deepAgents.js b/src/agent/deepAgents.js index 2bfdb4e2..878a8bb7 100644 --- a/src/agent/deepAgents.js +++ b/src/agent/deepAgents.js @@ -1,4 +1,4 @@ -import { createDeepAgent, CompositeBackend } from "deepagents"; +import { createDeepAgent, CompositeBackend, registerHarnessProfile, createHarnessProfile } from "deepagents"; import { join } from "node:path"; import { InMemoryStore } from "@langchain/langgraph-checkpoint"; import { loadConfig } from "../config/loader.js"; @@ -138,18 +138,17 @@ export async function createDeepAgentsOrchestrator(checkpointer = null) { const model = createChatModel(providerConfig); // Register harness profile for subagents using config-derived model identifier - /** const modelIdentifier = `${providerName}:${providerConfig.model}`; + const modelIdentifier = `${providerName}:${providerConfig.model}`; registerHarnessProfile( modelIdentifier, createHarnessProfile({ excludedMiddleware: [ "TodoListMiddleware", - //"FilesystemMiddleware", "SummarizationMiddleware", ], - excludedTools: ["write_todos"], + excludedTools: ["write_todos", "execute"], }), - ); **/ + ); // Build tools from config — filter to orchestrator-only tools const buildOptions = { From 04bdcebee0cadc0ecf53a77c6292a52394133447 Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Sun, 2 Aug 2026 13:53:07 -0400 Subject: [PATCH 2/4] fix: remove 'write_todos' from sub-agent excluded tools list write_todos was removed from the codebase entirely. The only remaining exclusion is 'execute', which is provided by the backend protocol and should only be available to the orchestrator. --- src/agent/deepAgents.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent/deepAgents.js b/src/agent/deepAgents.js index 878a8bb7..f898a0c3 100644 --- a/src/agent/deepAgents.js +++ b/src/agent/deepAgents.js @@ -146,7 +146,7 @@ export async function createDeepAgentsOrchestrator(checkpointer = null) { "TodoListMiddleware", "SummarizationMiddleware", ], - excludedTools: ["write_todos", "execute"], + excludedTools: ["execute"], }), ); From 1f1f2d520458a38e933f72ed24435be195c7e480 Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Sun, 2 Aug 2026 13:54:58 -0400 Subject: [PATCH 3/4] fix: remove middleware exclusions from sub-agent harness profile TodoListMiddleware and SummarizationMiddleware are now wanted on sub-agents. The only remaining exclusion is 'execute', which is provided by the backend protocol and should remain orchestrator-only. --- src/agent/deepAgents.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/agent/deepAgents.js b/src/agent/deepAgents.js index f898a0c3..a6181c11 100644 --- a/src/agent/deepAgents.js +++ b/src/agent/deepAgents.js @@ -142,10 +142,6 @@ export async function createDeepAgentsOrchestrator(checkpointer = null) { registerHarnessProfile( modelIdentifier, createHarnessProfile({ - excludedMiddleware: [ - "TodoListMiddleware", - "SummarizationMiddleware", - ], excludedTools: ["execute"], }), ); From 77c5c5ada0a4d7c02f35af5003d82e83a788a776 Mon Sep 17 00:00:00 2001 From: Jason Mulligan Date: Sun, 2 Aug 2026 13:57:45 -0400 Subject: [PATCH 4/4] fix: format deepAgents.js import per oxfmt rules --- src/agent/deepAgents.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/agent/deepAgents.js b/src/agent/deepAgents.js index a6181c11..81c9c4f0 100644 --- a/src/agent/deepAgents.js +++ b/src/agent/deepAgents.js @@ -1,4 +1,9 @@ -import { createDeepAgent, CompositeBackend, registerHarnessProfile, createHarnessProfile } from "deepagents"; +import { + createDeepAgent, + CompositeBackend, + registerHarnessProfile, + createHarnessProfile, +} from "deepagents"; import { join } from "node:path"; import { InMemoryStore } from "@langchain/langgraph-checkpoint"; import { loadConfig } from "../config/loader.js";