fix(nodes): resolve default node when multiple canvas-capable nodes are connected

`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) <noreply@anthropic.com>
This commit is contained in:
ACV
2026-02-26 11:35:50 +01:00
committed by Peter Steinberger
parent 4b4718c8df
commit 47bb568cb2

View File

@@ -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<NodeListNode[]> {