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.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(macos): break the permanently-Denied permission trap + one restart per onboarding
Ruben Lütke859ecfecd52d
diff --git a/jarvis/platform/permissions.py b/jarvis/platform/permissions.pyindex e611efbe88..0e079a005d 100644--- a/jarvis/platform/permissions.py+++ b/jarvis/platform/permissions.py@@ -141,6 +141,16 @@ def _default_credential_store_recover() -> bool:return try_recover_platform_credential_store()+# tccutil service names for the per-permission reset recovery. Keychain+# (credential_store) is not TCC-governed and has no resettable row.+_TCC_RESET_SERVICES: dict[PermissionId, str] = {+ PermissionId.MICROPHONE: "Microphone",+ PermissionId.SCREEN_RECORDING: "ScreenCapture",+ PermissionId.ACCESSIBILITY: "Accessibility",+ PermissionId.INPUT_MONITORING: "ListenEvent",+ PermissionId.EVENT_POSTING: "PostEvent",+}+_READY_STATES = frozenset({PermissionState.GRANTED, PermissionState.NOT_REQUIRED})_RESTART_AFTER_CHANGE = frozenset({@@ -713,6 +723,88 @@ class SystemPermissionPort:url = foundation.NSURL.URLWithString_(_SETTINGS_URLS[permission_id])return bool(appkit.NSWorkspace.sharedWorkspace().openURL_(url))+ def reset(+ self, permission_id: PermissionId, *, dry_run: bool = False+ ) -> PermissionOperation:+ """Drop this app's own TCC row so the native prompt can appear again.++ The in-app way out of the auto-denied trap: once ANY build of the+ app ever created an input listener before the user was asked - or a+ signature change orphaned the recorded grant (BUG-083) - macOS+ silently registers the app as DENIED and suppresses every further+ prompt. The permissions view then shows a dead "Denied" forever.+ ``tccutil reset <service> <our bundle id>`` returns that one row to+ "not determined" (never touching other apps' grants), so the real+ system dialog can fire again on the next request.+ """+ before = self.snapshot()+ service = _TCC_RESET_SERVICES.get(permission_id)+ if self.platform != "darwin" or service is None:+ return PermissionOperation(+ False,+ permission_id.value,+ "reset",+ False,+ dry_run,+ False,+ f"{_LABELS[permission_id]} has no resettable macOS record.",+ before,+ )+ if dry_run:+ return PermissionOperation(+ True,+ permission_id.value,+ "reset",+ False,+ True,+ False,+ f"Would reset this app's {_LABELS[permission_id]} record.",+ before,+ )+ import subprocess # lazy: this method is darwin-only at runtime++ from jarvis.core.process_utils import NO_WINDOW_CREATIONFLAGS+ from jarvis.setup.macos_app_bundle import BUNDLE_ID++ try:+ result = subprocess.run(+ ["/usr/bin/tccutil", "reset", service, BUNDLE_ID],+ capture_output=True,+ text=True,+ timeout=30,+ check=False,+ creationflags=NO_WINDOW_CREATIONFLAGS,+ )+ performed = result.returncode == 0+ detail = (result.stderr or result.stdout or "").strip()+ except (OSError, subprocess.TimeoutExpired) as exc:+ performed = False+ detail = str(exc)+ if not performed:+ return PermissionOperation(+ False,+ permission_id.value,+ "reset",+ False,+ False,+ False,+ f"Could not reset the {_LABELS[permission_id]} record: "+ f"{detail[-200:] or 'unknown error'}",+ before,+ )+ self._restart_required.discard(permission_id)+ return PermissionOperation(+ True,+ permission_id.value,+ "reset",+ True,+ False,+ False,+ f"{_LABELS[permission_id]} was reset - the system prompt can "+ "appear again on the next request.",+ self.snapshot(),+ )+def open_settings(self, permission_id: PermissionId, *, dry_run: bool = False) -> PermissionOperation:diff --git a/jarvis/setup/onboarding_meta.py b/jarvis/setup/onboarding_meta.pyindex 7810c19dc2..5cd0e812e0 100644--- a/jarvis/setup/onboarding_meta.py+++ b/jarvis/setup/onboarding_meta.py@@ -19,12 +19,17 @@ CURRENT_TERMS_VERSION = "1.0"# posture now rests on the up-front risk gate + the MIT-license disclaimer, so# first-run stays short. The /terms + /accept-terms routes remain for back-compat# but are no longer part of the guided flow.+# Restart batching (maintainer mandate 2026-07-18): permissions and wake-word+# sit LAST, directly before finish, because both only take full effect after a+# relaunch — and onboarding already ends with one unconditional fresh restart+# (onboarding_routes._schedule_fresh_restart). One restart covers everything;+# the guide must never demand a second one mid-flow.ONBOARDING_STEPS: list[str] = ["welcome","language",+ "api-keys","permissions","wake-word",- "api-keys","finish",]diff --git a/jarvis/ui/web/frontend/src/components/onboarding/OnboardingFlow.tsx b/jarvis/ui/web/frontend/src/components/onboarding/OnboardingFlow.tsxindex 2dbe0f4b80..57121c98d5 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/OnboardingFlow.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/OnboardingFlow.tsx@@ -18,12 +18,15 @@ export interface StepProps {isLast: boolean;}+// Restart batching (2026-07-18): permissions + wake-word sit LAST before+// finish — both only fully apply after a relaunch, and onboarding already+// ends with ONE unconditional fresh restart. Never demand a second one.const REGISTRY: Record<string, (p: StepProps) => JSX.Element> = {welcome: WelcomeStep,language: LanguageStep,+ "api-keys": ApiKeysStep,permissions: PermissionsStep,"wake-word": WakeWordStep,- "api-keys": ApiKeysStep,finish: FinishStep,};diff --git a/jarvis/ui/web/frontend/src/components/onboarding/steps/PermissionsStep.tsx b/jarvis/ui/web/frontend/src/components/onboarding/steps/PermissionsStep.tsxindex 61cdb02de4..1f9a1edf91 100644--- a/jarvis/ui/web/frontend/src/components/onboarding/steps/PermissionsStep.tsx+++ b/jarvis/ui/web/frontend/src/components/onboarding/steps/PermissionsStep.tsx@@ -19,7 +19,7 @@ export function permissionSnapshotReady(snapshot: PermissionSnapshot | null): boif (!snapshot) return false;if (snapshot.platform === "linux" || snapshot.platform === "win32") return true;if (snapshot.platform !== "darwin") return false;- if (snapshot.app_identity.stable !== true || snapshot.restart_required) return false;+ if (snapshot.app_identity.stable !== true) return false;if (snapshot.permissions.length !== EXPECTED_MACOS_PERMISSIONS.size) return false;const observed = new Set(snapshot.permissions.map((item) => item.id));@@ -29,8 +29,16 @@ export function permissionSnapshotReady(snapshot: PermissionSnapshot | null): bo) {return false;}- return snapshot.permissions.every((item) =>- ["granted", "not_required"].includes(item.status),+ // Restart batching (2026-07-18): a granted-but-stale row (macOS freezes+ // some TCC probes per process, so the grant only reads back after a+ // relaunch) counts as satisfied here — onboarding ends with ONE+ // unconditional fresh restart that applies it. Blocking Continue on+ // restart_required forced a mid-flow restart that threw users back to+ // step 1 and doubled the total restarts.+ return snapshot.permissions.every(+ (item) =>+ ["granted", "not_required"].includes(item.status) ||+ item.restart_required === true,);}@@ -57,7 +65,7 @@ export function PermissionsStep({ goNext, skip }: StepProps) {</div></div>- <PermissionRows compact onSnapshot={onSnapshot} />+ <PermissionRows compact deferRestartNote onSnapshot={onSnapshot} /><p className="text-xs text-muted-foreground">{t("onboarding.permissions.privacy_note")}diff --git a/jarvis/ui/web/frontend/src/hooks/usePermissions.ts b/jarvis/ui/web/frontend/src/hooks/usePermissions.tsindex eb59af7366..e6eaa3d063 100644--- a/jarvis/ui/web/frontend/src/hooks/usePermissions.ts+++ b/jarvis/ui/web/frontend/src/hooks/usePermissions.ts@@ -109,7 +109,7 @@ export function usePermissions() {}, []);const mutate = useCallback(- async (id: PermissionId, action: "request" | "open-settings") => {+ async (id: PermissionId, action: "request" | "open-settings" | "reset") => {setPendingId(id);try {const payload = await readJson(@@ -171,5 +171,6 @@ export function usePermissions() {refetch,request: (id: PermissionId) => mutate(id, "request"),openSettings: (id: PermissionId) => mutate(id, "open-settings"),+ reset: (id: PermissionId) => mutate(id, "reset"),};}diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex c5ff92fe92..c30deec454 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -1072,12 +1072,30 @@"restart_pending": "Neustart ausstehend"},"items": {- "microphone": { "title": "Mikrofon", "description": "Erforderlich für Aktivierungswort und lokale Spracheingabe." },- "screen_recording": { "title": "Bildschirmaufnahme", "description": "Erforderlich, damit Computer-Use alle verbundenen Bildschirme sehen kann." },- "accessibility": { "title": "Bedienungshilfen", "description": "Erforderlich für zuverlässige Klicks, Eingaben, Fokus und Fenstersteuerung." },- "input_monitoring": { "title": "Eingabeüberwachung", "description": "Erforderlich für globale Push-to-Talk- und Tastaturkurzbefehle." },- "event_posting": { "title": "Eingabesteuerung", "description": "Erforderlich, damit Computer-Use Maus- und Tastaturereignisse senden kann." },- "credential_store": { "title": "Schlüsselbund (API-Keys)", "description": "Speichert deine API-Keys verschlüsselt im macOS-Schlüsselbund statt in einer Klartextdatei — genau dafür fragt macOS beim Start der App. Deine Keys bleiben auf deinem Mac und werden nirgendwohin gesendet." }+ "microphone": {+ "title": "Mikrofon",+ "description": "Erforderlich für Aktivierungswort und lokale Spracheingabe."+ },+ "screen_recording": {+ "title": "Bildschirmaufnahme",+ "description": "Erforderlich, damit Computer-Use alle verbundenen Bildschirme sehen kann."+ },+ "accessibility": {+ "title": "Bedienungshilfen",+ "description": "Erforderlich für zuverlässige Klicks, Eingaben, Fokus und Fenstersteuerung."+ },+ "input_monitoring": {+ "title": "Eingabeüberwachung",+ "description": "Erforderlich für globale Push-to-Talk- und Tastaturkurzbefehle."+ },+ "event_posting": {+ "title": "Eingabesteuerung",+ "description": "Erforderlich, damit Computer-Use Maus- und Tastaturereignisse senden kann."+ },+ "credential_store": {+ "title": "Schlüsselbund (API-Keys)",+ "description": "Speichert deine API-Keys verschlüsselt im macOS-Schlüsselbund statt in einer Klartextdatei — genau dafür fragt macOS beim Start der App. Deine Keys bleiben auf deinem Mac und werden nirgendwohin gesendet."+ }},"banner": {"title": "Aktion nötig: macOS-Berechtigungen fehlen",@@ -1092,7 +1110,9 @@"global_hotkeys": "Globale Kurzbefehle","window_control": "Fenstersteuerung","api_keys": "Sichere API-Key-Ablage"- }+ },+ "restart_deferred": "Neu erteilte Freigaben werden mit dem automatischen Neustart am Ende der Einrichtung aktiv - jetzt ist nichts zu tun.",+ "ask_again": "Erneut fragen"},"settings_view": {"silence_window": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex ec729101f5..336771c96e 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -1073,12 +1073,30 @@"restart_pending": "Restart pending"},"items": {- "microphone": { "title": "Microphone", "description": "Required for wake-word and local voice input." },- "screen_recording": { "title": "Screen Recording", "description": "Required for Computer-Use to see every connected display." },- "accessibility": { "title": "Accessibility", "description": "Required for reliable clicks, typing, focus, and window control." },- "input_monitoring": { "title": "Input Monitoring", "description": "Required for global push-to-talk and keyboard shortcuts." },- "event_posting": { "title": "Input control", "description": "Required for Computer-Use to send mouse and keyboard events." },- "credential_store": { "title": "Keychain (API keys)", "description": "Stores your API keys encrypted in the macOS Keychain instead of a plain file — that is the Keychain prompt you see when the app starts. Your keys stay on your Mac and are never sent anywhere." }+ "microphone": {+ "title": "Microphone",+ "description": "Required for wake-word and local voice input."+ },+ "screen_recording": {+ "title": "Screen Recording",+ "description": "Required for Computer-Use to see every connected display."+ },+ "accessibility": {+ "title": "Accessibility",+ "description": "Required for reliable clicks, typing, focus, and window control."+ },+ "input_monitoring": {+ "title": "Input Monitoring",+ "description": "Required for global push-to-talk and keyboard shortcuts."+ },+ "event_posting": {+ "title": "Input control",+ "description": "Required for Computer-Use to send mouse and keyboard events."+ },+ "credential_store": {+ "title": "Keychain (API keys)",+ "description": "Stores your API keys encrypted in the macOS Keychain instead of a plain file — that is the Keychain prompt you see when the app starts. Your keys stay on your Mac and are never sent anywhere."+ }},"banner": {"title": "Action needed: macOS permissions are missing",@@ -1093,7 +1111,9 @@"global_hotkeys": "Global shortcuts","window_control": "Window control","api_keys": "Secure API-key storage"- }+ },+ "restart_deferred": "Newly granted access turns on with the automatic restart at the end of setup - nothing to do now.",+ "ask_again": "Ask again"},"settings_view": {"silence_window": {diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex a791fe5be0..24c4a966f9 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -1072,12 +1072,30 @@"restart_pending": "Reinicio pendiente"},"items": {- "microphone": { "title": "Micrófono", "description": "Necesario para la palabra de activación y la entrada de voz local." },- "screen_recording": { "title": "Grabación de pantalla", "description": "Necesario para que Computer-Use vea todas las pantallas conectadas." },- "accessibility": { "title": "Accesibilidad", "description": "Necesario para clics, escritura, enfoque y control de ventanas fiables." },- "input_monitoring": { "title": "Monitorización de entrada", "description": "Necesario para pulsar para hablar y atajos de teclado globales." },- "event_posting": { "title": "Control de entrada", "description": "Necesario para que Computer-Use envíe eventos de ratón y teclado." },- "credential_store": { "title": "Llavero (claves API)", "description": "Guarda tus claves API cifradas en el Llavero de macOS en lugar de un archivo de texto plano — ese es el aviso del Llavero que ves al iniciar la app. Tus claves se quedan en tu Mac y nunca se envían a ningún sitio." }+ "microphone": {+ "title": "Micrófono",+ "description": "Necesario para la palabra de activación y la entrada de voz local."+ },+ "screen_recording": {+ "title": "Grabación de pantalla",+ "description": "Necesario para que Computer-Use vea todas las pantallas conectadas."+ },+ "accessibility": {+ "title": "Accesibilidad",+ "description": "Necesario para clics, escritura, enfoque y control de ventanas fiables."+ },+ "input_monitoring": {+ "title": "Monitorización de entrada",+ "description": "Necesario para pulsar para hablar y atajos de teclado globales."+ },+ "event_posting": {+ "title": "Control de entrada",+ "description": "Necesario para que Computer-Use envíe eventos de ratón y teclado."+ },+ "credential_store": {+ "title": "Llavero (claves API)",+ "description": "Guarda tus claves API cifradas en el Llavero de macOS en lugar de un archivo de texto plano — ese es el aviso del Llavero que ves al iniciar la app. Tus claves se quedan en tu Mac y nunca se envían a ningún sitio."+ }},"banner": {"title": "Acción necesaria: faltan permisos de macOS",@@ -1092,7 +1110,9 @@"global_hotkeys": "Atajos globales","window_control": "Control de ventanas","api_keys": "Almacenamiento seguro de claves API"- }+ },+ "restart_deferred": "Los permisos recién concedidos se activan con el reinicio automático al final de la configuración; no hay nada que hacer ahora.",+ "ask_again": "Preguntar de nuevo"},"settings_view": {"silence_window": {diff --git a/jarvis/ui/web/frontend/src/views/settings/PermissionsPanel.tsx b/jarvis/ui/web/frontend/src/views/settings/PermissionsPanel.tsxindex 1cea5026da..4d7a1c7ab5 100644--- a/jarvis/ui/web/frontend/src/views/settings/PermissionsPanel.tsx+++ b/jarvis/ui/web/frontend/src/views/settings/PermissionsPanel.tsx@@ -36,15 +36,22 @@ const READY_STATES = new Set(["granted", "not_required"]);export function PermissionRows({compact = false,+ deferRestartNote = false,onSnapshot,}: {compact?: boolean;+ /**+ * Onboarding mode: the guide ends with ONE unconditional fresh restart,+ * so a granted-but-stale permission shows a calm "applies after the+ * final restart" note instead of the amber restart-now demand.+ */+ deferRestartNote?: boolean;onSnapshot?: (snapshot: PermissionSnapshot | null) => void;}) {const t = useT();const pushToast = useEventStore((state) => state.pushToast);const [restarting, setRestarting] = useState(false);- const { snapshot, loading, error, pendingId, refetch, request, openSettings } =+ const { snapshot, loading, error, pendingId, refetch, request, openSettings, reset } =usePermissions();useEffect(() => {@@ -125,9 +132,15 @@ export function PermissionRows({compact={compact}onRequest={() => run(() => request(permission.id))}onOpenSettings={() => run(() => openSettings(permission.id))}+ onReset={() => run(() => reset(permission.id))}/>))}- {snapshot?.restart_required && (+ {snapshot?.restart_required && deferRestartNote && (+ <p className="text-xs text-muted-foreground">+ {t("permissions.restart_deferred")}+ </p>+ )}+ {snapshot?.restart_required && !deferRestartNote && (<div className="flex flex-wrap items-center justify-between gap-2 rounded-lg border border-amber-500/40 bg-amber-500/5 p-3"><p className="text-xs text-amber-500">{t("permissions.restart_required")}</p><Button size="sm" disabled={restarting} onClick={() => void restartApp()}>@@ -147,12 +160,14 @@ function PermissionRow({compact,onRequest,onOpenSettings,+ onReset,}: {item: PermissionItem;busy: boolean;compact: boolean;onRequest: () => void;onOpenSettings: () => void;+ onReset: () => void;}) {const t = useT();const Icon = ICONS[item.id];@@ -162,6 +177,13 @@ function PermissionRow({// "asked and denied". Keep the Settings escape hatch visible alongside the// first-party request button so a prior denial is always recoverable.const showSettings = !ready && item.can_open_settings;+ // macOS auto-denies an app that ever created an input listener before the+ // user was asked, and a signature change orphans recorded grants (BUG-083)+ // — either way the row reads a dead "Denied" and macOS never prompts+ // again. "Ask again" drops OUR OWN record (tccutil, scoped to this app's+ // bundle id) so the real system dialog can fire once more. Keychain has+ // no TCC row, hence the exclusion.+ const showReset = item.status === "denied" && item.id !== "credential_store";// Screen Recording is the one probe macOS freezes per process: after the// user grants it in System Settings, the live value stays stale until the// app restarts. Show the honest pending label instead of the stale state;@@ -207,6 +229,12 @@ function PermissionRow({{t("permissions.open_settings")}</Button>)}+ {showReset && (+ <Button size="sm" variant="ghost" disabled={busy} onClick={onReset}>+ {busy && <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" />}+ {t("permissions.ask_again")}+ </Button>+ )}</div></div>);diff --git a/jarvis/ui/web/permissions_routes.py b/jarvis/ui/web/permissions_routes.pyindex 36eddf3b45..06744364d0 100644--- a/jarvis/ui/web/permissions_routes.py+++ b/jarvis/ui/web/permissions_routes.py@@ -70,4 +70,25 @@ def open_permission_settings(return _operation_response(payload)+ "/{permission_id}/reset",+ summary="Reset this app's own system permission record",+ openapi_extra={"x-jarvis-dangerous": True},+ response_model=None,+)+def reset_permission(+ permission_id: PermissionId,+ request: Request,+ dry_run: bool = Query(default=False),+) -> Any:+ """Drop the app's own macOS TCC row so the native prompt can reappear.++ Recovery for the permanently-"Denied" trap: macOS auto-denies an app+ that ever listened before being asked and then never prompts again.+ Scoped strictly to this app's bundle id; other apps stay untouched.+ """+ payload = _port(request).reset(permission_id, dry_run=dry_run).to_dict()+ return _operation_response(payload)++__all__ = ["router"]diff --git a/tests/unit/setup/test_onboarding_meta.py b/tests/unit/setup/test_onboarding_meta.pyindex 83f9c350b4..409771eb8f 100644--- a/tests/unit/setup/test_onboarding_meta.py+++ b/tests/unit/setup/test_onboarding_meta.py@@ -8,16 +8,19 @@ def test_meta_constants():# gate + MIT-license disclaimer carry the legal posture now.assert "terms" not in m.ONBOARDING_STEPSassert m.ONBOARDING_STEPS[1] == "language"- assert m.ONBOARDING_STEPS[2] == "permissions"+ # Restart batching (2026-07-18): permissions + wake-word sit LAST before+ # finish so the single unconditional completion restart covers both — the+ # guide must never force a second mid-flow restart.+ assert m.ONBOARDING_STEPS[2] == "api-keys"assert m.ONBOARDING_STEPS.index("permissions") < m.ONBOARDING_STEPS.index("wake-word")assert m.ONBOARDING_STEPS[-1] == "finish"assert "wake-word" in m.ONBOARDING_STEPSassert "persona-theme" not in m.ONBOARDING_STEPS# Persona-name, overlay-style and the mic check were moved out of onboarding- # to keep first-run short; it ends at api-keys → finish (removed 2026-06-20).+ # to keep first-run short (removed 2026-06-20).assert "system-style" not in m.ONBOARDING_STEPSassert "mic-test" not in m.ONBOARDING_STEPS- assert m.ONBOARDING_STEPS[-2] == "api-keys"+ assert m.ONBOARDING_STEPS[-2] == "wake-word"assert len(m.ONBOARDING_STEPS) == 6assert len(m.WAKE_WORD_LEGAL_REFERENCES) >= 3for ref in m.WAKE_WORD_LEGAL_REFERENCES: