From a80cf3842e770e151fd2cce3828cfc6139c6eb82 Mon Sep 17 00:00:00 2001 From: Alessandro Frau <155005371+3clyp50@users.noreply.github.com> Date: Sat, 23 May 2026 13:32:47 +0200 Subject: [PATCH] Treat computer-use approval denial as rearm required Map COMPUTER_USE_APPROVAL_REQUIRED tool responses into the existing COMPUTER_USE_REARM_REQUIRED stop guidance. This keeps agents from retrying desktop actions or using screenshot fallbacks when macOS permissions still require a user-approved re-arm. --- plugins/_a0_connector/tools/computer_use_remote.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/_a0_connector/tools/computer_use_remote.py b/plugins/_a0_connector/tools/computer_use_remote.py index f0e60332e..f7edcee2b 100644 --- a/plugins/_a0_connector/tools/computer_use_remote.py +++ b/plugins/_a0_connector/tools/computer_use_remote.py @@ -357,7 +357,10 @@ class ComputerUseRemote(Tool): def _format_error(self, result: dict[str, Any]) -> str: error = str(result.get("error") or "Unknown error") code = str(result.get("code") or "") - if code == "COMPUTER_USE_REARM_REQUIRED" or error == "COMPUTER_USE_REARM_REQUIRED": + if code in {"COMPUTER_USE_REARM_REQUIRED", "COMPUTER_USE_APPROVAL_REQUIRED"} or error in { + "COMPUTER_USE_REARM_REQUIRED", + "COMPUTER_USE_APPROVAL_REQUIRED", + }: detail = error if error and error != code else REARM_REQUIRED_DEFAULT_MESSAGE return ( "COMPUTER_USE_REARM_REQUIRED: "