The Codex Desktop restart route already supports a Windows PowerShell script, but macOS installations can have Codex.app available without any Restart-CodexDesktop.ps1 file or pwsh. In that case the web restart control reports a missing script even though the desktop app is installed.
This adds a native macOS path that detects Codex.app, reports running state via pgrep, and restarts the app with osascript plus open when no custom restart script is configured. Existing configured scripts and Windows behavior stay unchanged.
Constraint: macOS users may not have PowerShell installed for the Codex Desktop restart control.
Rejected: Require HAPI_CODEX_RESTART_SCRIPT on macOS | preserves the current failure mode for default installs.
Confidence: medium
Scope-risk: narrow
Directive: Keep configured restart scripts higher priority than native macOS fallback so operators can override local app behavior.
Tested: bun test hub/src/web/routes/codexDesktop.test.ts
Tested: tsc -p hub/tsconfig.json --noEmit
Not-tested: Manual click of restart button, to avoid restarting the active Codex desktop session during development.
Co-authored-by: zhangrui <3014594405@qq.com>