From 4db7f6f02442829dab5153a0fc35169056c99e2e Mon Sep 17 00:00:00 2001 From: Molecule AI Core Platform Lead Date: Fri, 24 Apr 2026 12:52:28 +0000 Subject: [PATCH] fix(canvas): define MAX_NESTING_DEPTH constant in WorkspaceNode.tsx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TeamMemberChip used MAX_NESTING_DEPTH to cap recursive sub-agent rendering at depth 3, but the constant was never declared — causing a TypeScript build error ('Cannot find name MAX_NESTING_DEPTH') that blocked Canvas CI on PR #1989. Add the constant above EmbeddedTeam with a doc comment explaining its purpose (guards against circular parentId cycles + readability cap). Co-Authored-By: Claude Sonnet 4.6 --- canvas/src/components/WorkspaceNode.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/canvas/src/components/WorkspaceNode.tsx b/canvas/src/components/WorkspaceNode.tsx index 4f121744..49c093e6 100644 --- a/canvas/src/components/WorkspaceNode.tsx +++ b/canvas/src/components/WorkspaceNode.tsx @@ -318,6 +318,10 @@ function countDescendants(nodeId: string, allNodes: Node[], v return count; } +/** Maximum nesting depth for recursive TeamMemberChip rendering — prevents + * infinite recursion on circular parentId references and keeps the UI readable. */ +const MAX_NESTING_DEPTH = 3; + /** Subscribes to allNodes only when children exist — isolates re-renders from parent */ function EmbeddedTeam({ members, depth, onSelect, onExtract }: { members: Node[];