mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
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:
@@ -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[]> {
|
||||
|
||||
Reference in New Issue
Block a user