From d9ae20c355c91add55ff1de7ef8f4383c0224794 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 16 Nov 2026 17:38:55 -0800 Subject: [PATCH] improvement(computer-use): report an advertised action the element refuses as unsupported, with the snapshot still valid --- apps/desktop/native/computer-use/ComputerUse.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/desktop/native/computer-use/ComputerUse.swift b/apps/desktop/native/computer-use/ComputerUse.swift index 33104ba8046..3529be2c61a 100644 --- a/apps/desktop/native/computer-use/ComputerUse.swift +++ b/apps/desktop/native/computer-use/ComputerUse.swift @@ -56,6 +56,10 @@ func dispatchAX(_ element: AXUIElement, press: Bool = false, _ operation: (AXUIE let result = operation(element) if ![.illegalArgument, .attributeUnsupported, .actionUnsupported, .notImplemented, .apiDisabled].contains(result) { inputDispatched = true } if result == .success || result == .cannotComplete && press { return } + // Some elements advertise an action they then refuse (Finder and file-panel cells with AXOpen); nothing reached the app. + if result == .actionUnsupported { + throw ComputerError("unsupported_action", "The element advertises this action but refused it. Use another of its actions or click it instead (clickCount 2 opens most files and folders).") + } try axCheck(result) } /// Some apps (Calendar on macOS 26) answer AXPress on a menu item by opening its menu with the item