From 0b8fe9661b0ad8d78a23d92b72d46538ede88910 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Wed, 28 Jan 2026 16:32:58 -0800 Subject: [PATCH] fix: mark subagents as hidden on creation (#730) Co-authored-by: Letta --- src/agent/create.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/agent/create.ts b/src/agent/create.ts index 67f66fb..e55caf5 100644 --- a/src/agent/create.ts +++ b/src/agent/create.ts @@ -305,8 +305,9 @@ export async function createAgent( // Create agent with inline memory blocks (LET-7101: single API call instead of N+1) // - memory_blocks: new blocks to create inline // - block_ids: references to existing blocks (for shared memory) + const isSubagent = process.env.LETTA_CODE_AGENT_ROLE === "subagent"; const tags = ["origin:letta-code"]; - if (process.env.LETTA_CODE_AGENT_ROLE === "subagent") { + if (isSubagent) { tags.push("role:subagent"); } @@ -328,6 +329,7 @@ export async function createAgent( // Referenced block IDs (existing blocks to attach) block_ids: referencedBlockIds.length > 0 ? referencedBlockIds : undefined, tags, + ...(isSubagent && { hidden: true }), // should be default off, but just in case include_base_tools: false, include_base_tool_rules: false,