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.

fix(macos): log the quiet failure paths of the signing identity and Automation probe

Harald Herz665c71f7e43b
diff --git a/jarvis/platform/permissions.py b/jarvis/platform/permissions.py
index c2ab3af743..2d7442bbe4 100644
--- a/jarvis/platform/permissions.py
+++ b/jarvis/platform/permissions.py
@@ -293,7 +293,8 @@ def _default_automation_probe(bundle_id: str, ask: bool) -> int | None:
ctypes.c_ubyte,
]
determine.restype = ctypes.c_int32
- except (OSError, AttributeError):
+ except (OSError, AttributeError) as exc:
+ log.debug("Apple Event Manager is unavailable for the Automation probe: %s", exc)
return None
target = _AEDesc()
data = bundle_id.encode("utf-8")
@@ -764,6 +765,8 @@ class SystemPermissionPort:
try:
state = PermissionState(recorded[bundle_id])
except (KeyError, ValueError):
+ # Nothing recorded for this player (or an unknown value
+ # from a newer build): "not asked yet" is the honest read.
state = PermissionState.NOT_DETERMINED
elif state in _CONSENT_ANSWERS:
updated[bundle_id] = state.value
diff --git a/jarvis/setup/macos_app_bundle.py b/jarvis/setup/macos_app_bundle.py
index a5fcd52054..96995ca54d 100644
--- a/jarvis/setup/macos_app_bundle.py
+++ b/jarvis/setup/macos_app_bundle.py
@@ -227,7 +227,8 @@ def _bundle_tcc_identity(bundle: Path) -> str | None:
check=False,
creationflags=NO_WINDOW_CREATIONFLAGS,
)
- except (OSError, subprocess.TimeoutExpired):
+ except (OSError, subprocess.TimeoutExpired) as exc:
+ log.debug("codesign could not read the designated requirement of %s: %s", bundle, exc)
return None
return _parse_designated_requirement(f"{result.stdout or ''}\n{result.stderr or ''}")
diff --git a/jarvis/setup/macos_signing_identity.py b/jarvis/setup/macos_signing_identity.py
index d2f7a25402..c9f86a061f 100644
--- a/jarvis/setup/macos_signing_identity.py
+++ b/jarvis/setup/macos_signing_identity.py
@@ -93,7 +93,8 @@ def _gui_session(runner: Runner) -> bool:
"""Only an Aqua session can show the trust-settings password dialog."""
try:
result = _run(runner, ["/bin/launchctl", "managername"], timeout=10)
- except (OSError, subprocess.TimeoutExpired):
+ except (OSError, subprocess.TimeoutExpired) as exc:
+ log.debug("launchctl managername did not answer; assuming no GUI session: %s", exc)
return False
return (result.stdout or "").strip() == "Aqua"
@@ -101,7 +102,8 @@ def _gui_session(runner: Runner) -> bool:
def _login_keychain(runner: Runner) -> str | None:
try:
result = _run(runner, [_SECURITY, "default-keychain", "-d", "user"], timeout=10)
- except (OSError, subprocess.TimeoutExpired):
+ except (OSError, subprocess.TimeoutExpired) as exc:
+ log.debug("security default-keychain did not answer: %s", exc)
return None
path = (result.stdout or "").strip().strip('"')
return path or None
@@ -196,6 +198,8 @@ def create_local_signing_identity(runner: Runner = subprocess.run) -> str | None
stream.write(p12)
cert_path.write_bytes(cert_pem)
except OSError as exc:
+ # Reported through last_error(): the caller logs it with the
+ # consequence (ad-hoc signing) once, instead of twice here.
_LAST_ERROR = f"could not stage the identity: {exc}"
return None
steps: list[tuple[str, list[str], float]] = [
@@ -226,6 +230,8 @@ def create_local_signing_identity(runner: Runner = subprocess.run) -> str | None
try:
result = _run(runner, argv, timeout=timeout)
except (OSError, subprocess.TimeoutExpired) as exc:
+ # Reported through last_error() by the caller, with the
+ # consequence (the app stays ad-hoc signed) spelled out.
_LAST_ERROR = f"security {name} did not complete: {exc}"
return None
if result.returncode != 0: