mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-30 03:35:47 +00:00
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.
This commit is contained in:
parent
4a836940f3
commit
a80cf3842e
1 changed files with 4 additions and 1 deletions
|
|
@ -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: "
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue