From 75f8dd32935075e07d5c6db958b33fd52889e3ef Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 3 Sep 2026 09:47:10 -0700 Subject: [PATCH] =?UTF-8?q?review-fix(suppress-audit):=20tools/computer=5F?= =?UTF-8?q?use/tool.py=20=E2=80=94=20restore=20BASE=20exception=20semantic?= =?UTF-8?q?s=20in=20=5Fbounds=5Fhints=20(int()=20failures=20propagate=20as?= =?UTF-8?q?=20on=20main)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/computer_use/tool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/computer_use/tool.py b/tools/computer_use/tool.py index 1405e548f8..518f497f14 100644 --- a/tools/computer_use/tool.py +++ b/tools/computer_use/tool.py @@ -480,9 +480,11 @@ def _bounds_hints(elements: List[UIElement], image_width: int, image_height: int return None, None max_x = max_y = 0 for e in elements: - with contextlib.suppress(TypeError, ValueError): + try: x, y, w, h = e.bounds - max_x, max_y = max(max_x, int(x) + int(w)), max(max_y, int(y) + int(h)) + except (TypeError, ValueError): + continue + max_x, max_y = max(max_x, int(x) + int(w)), max(max_y, int(y) + int(h)) if max_x <= image_width * 1.05 and max_y <= image_height * 1.05: return None, None note = (f"element bounds are in native desktop coordinates (extend to ~{max_x}x{max_y}), "