From 47bb568cb2ac3f4e3923be71f955709cc9ea1f64 Mon Sep 17 00:00:00 2001 From: ACV Date: Thu, 26 Feb 2026 11:35:50 +0100 Subject: [PATCH] fix(nodes): resolve default node when multiple canvas-capable nodes are connected MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `pickDefaultNode()` returned null when multiple connected canvas-capable nodes existed and none matched the local Mac heuristic. This caused "node required" errors for agents (especially sub-agents) calling the canvas tool without an explicit node parameter. In multi-node setups, any canvas-capable node is a valid target — the receiving node broadcasts A2UI surfaces to all other connected devices. Fall back to the first connected candidate instead of failing. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/agents/tools/nodes-utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/agents/tools/nodes-utils.ts b/src/agents/tools/nodes-utils.ts index 6350294eb55..8dbda644ef6 100644 --- a/src/agents/tools/nodes-utils.ts +++ b/src/agents/tools/nodes-utils.ts @@ -45,7 +45,10 @@ function pickDefaultNode(nodes: NodeListNode[]): NodeListNode | null { return local[0]; } - return null; + // Multiple candidates — pick the first connected canvas-capable node. + // For A2UI and other canvas operations, any node works since multi-node + // setups broadcast surfaces across devices. + return candidates[0] ?? null; } export async function listNodes(opts: GatewayCallOptions): Promise {