Skip to content

Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.

perf(macos): bound EVERY AX window candidate + cap raise_after_launch (the actual change)

Personal Jarvis Maintainer426f5b33202e
diff --git a/jarvis/platform/window_state.py b/jarvis/platform/window_state.py
index daee1b304b..0122ef78be 100644
--- a/jarvis/platform/window_state.py
+++ b/jarvis/platform/window_state.py
@@ -328,6 +328,13 @@ def _select_macos_ax_window(
fallback for minimized windows whose geometry is unavailable; duplicate
titles fail closed instead of focusing or resizing an arbitrary sibling.
"""
+ # Bound EVERY candidate before reading its attributes: the messaging
+ # timeout is per-element, and this loop reads geometry/titles of N
+ # windows — with the ~6 s OS default, one busy app with several windows
+ # blew the CU action budget right here (live 2026-07-21, second
+ # occurrence: bounding only root+target was not enough).
+ for window in windows:
+ _macos_bound_ax_messaging(window)
cg_bounds = _macos_entry_bounds(entry)
if cg_bounds is not None:
geometry_matches = [
diff --git a/jarvis/plugins/tool/open_app.py b/jarvis/plugins/tool/open_app.py
index 331611e614..533fd403b6 100644
--- a/jarvis/plugins/tool/open_app.py
+++ b/jarvis/plugins/tool/open_app.py
@@ -408,9 +408,20 @@ class OpenAppTool:
# existing browser window; the app-name match would not apply).
raised = False
if not is_url and not is_path:
+ # Hard overall cap: the poll (3s) plus a slow AX raise must
+ # never approach the CU dispatcher's 15s action budget — the
+ # launch already succeeded, the raise only softens the
+ # readback.
try:
- raised, _ = await asyncio.to_thread(
- window_state.raise_after_launch, app_name
+ async with asyncio.timeout(6.0):
+ raised, _ = await asyncio.to_thread(
+ window_state.raise_after_launch, app_name
+ )
+ except TimeoutError:
+ raised = False
+ logger.warning(
+ "[open_app] raise_after_launch for %r exceeded 6s — "
+ "reporting the launch without the raise", app_name,
)
except Exception: # noqa: BLE001 — never fail a successful launch
raised = False