From 8b332c673555037b817daed3ab76fb412e7fd57f Mon Sep 17 00:00:00 2001 From: Cyrus Gray <144336577+graycyrus@users.noreply.github.com> Date: Thu, 2 Apr 2026 23:02:48 +0530 Subject: [PATCH] fix(tauri): resolve "Command restart_core_process not found" stale ACL (#280) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(onboarding): remove MnemonicStep and Open Accessibility button, add Recovery Phrase settings panel - Remove "Open Accessibility" button from ScreenPermissionsStep (step 2) - Remove MnemonicStep (step 5) from onboarding, reducing total steps from 6 to 5 - Move onboarding completion logic (setOnboardedForUser + setOnboardingCompleted) into handleSkillsNext - Add RecoveryPhrasePanel in Settings with the same BIP39 generate/import functionality - Wire recovery-phrase route into Settings.tsx, SettingsHome menu, and useSettingsNavigation * fix(recovery-phrase): add aria-labels to import inputs and word-count selector Address CodeRabbit review feedback: - Add aria-label to each recovery phrase word input for screen readers - Add word-count selector (12/15/18/21/24) so longer phrases can be entered manually, not just via paste * fix(recovery-phrase): remove auto-advance on single char and guard clipboard fallback Address CodeRabbit round 2: - Remove auto-focus-advance after single character input (was breaking manual word entry — typing 'abandon' would split across slots) - Guard execCommand('copy') fallback with return value check * fix(tauri): resolve "Command restart_core_process not found" by fixing stale ACL builds Add cargo:rerun-if-changed directives for permissions/ and capabilities/ directories in build.rs so Tauri regenerates ACL tables on incremental builds. Also add missing permission entries for dictation hotkey commands. Closes #270 --- .claude/memory.md | 9 +-------- app/src-tauri/Cargo.lock | 2 +- app/src-tauri/build.rs | 6 ++++++ app/src-tauri/permissions/allow-core-process.toml | 4 +++- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.claude/memory.md b/.claude/memory.md index 20b5a2a56..3d035ff3f 100644 --- a/.claude/memory.md +++ b/.claude/memory.md @@ -8,6 +8,7 @@ Quick reference for anyone starting with Claude on this project. Updated by the - **Socket not connected at startup** — `SocketProvider` only connects when a Redux `auth.token` is set. At fresh launch (no token), socket is null, so any `callCoreRpc()` call falls back to `fetch()`. Always use `invoke('core_rpc_relay')` for local sidecar RPC calls. - **`openhuman.agent_server_status` doesn't exist** — This RPC method is not registered in the core. The gate checks it but it always errors. The gate passes if either service is Running OR agent server is running OR core is reachable. - **Cargo incremental builds can serve stale UI** — If the app shows old frontend after a Rust rebuild, run `cargo clean --manifest-path app/src-tauri/Cargo.toml` before rebuilding. +- **`build.rs` missing `rerun-if-changed` causes stale ACL / "Command not found" at runtime** — `app/src-tauri/build.rs` had no `cargo:rerun-if-changed` directives for `permissions/` or `capabilities/`. Adding/changing TOML or JSON files there did not re-trigger `tauri-build`, so ACL tables were stale and registered commands silently failed. Fixed by adding `println!("cargo:rerun-if-changed=permissions")` and `println!("cargo:rerun-if-changed=capabilities")` in `build.rs` (issue #270). Also: any new Tauri command must have a matching entry in a `permissions/` TOML file or it will hit the same error even if it is in `generate_handler!`. - **macOS deep links require .app bundle** — `yarn tauri dev` does NOT support deep links. Must use `yarn tauri build --debug --bundles app`. ## Strict Rules @@ -58,14 +59,6 @@ Quick reference for anyone starting with Claude on this project. Updated by the - **Patch is fragile** — Resets on `cargo clean`, crate version bump, or registry re-download. Deleting build cache alone (`target/debug/build/whisper-rs-sys-*`) is NOT enough — cmake regenerates with the same bad flags. - **Correct fix** — Needs an upstream patch in `whisper-rs-sys` or a Cargo feature to opt out of `GGML_NATIVE` on Apple Silicon cross-builds. -## Build Blockers: macOS Tahoe + whisper-rs - -- **`whisper-rs` breaks `cargo build` on macOS Tahoe (Apple Silicon)** — Added in main via `whisper-rs = "0.16"` (voice feature #178). Apple clang 21+ refuses `-mcpu=native` when `--target=arm64-apple-macosx` is also set. This is NOT fixable by updating CLT. -- **Root cause** — ggml cmake sets `GGML_NATIVE=ON` by default; the cmake crate appends `--target` to clang, triggering the incompatibility. Happens even with the latest toolchain. -- **Workaround** — Patch `~/.cargo/registry/src/index.crates.io-*/whisper-rs-sys-0.15.0/build.rs`: add `config.define("GGML_NATIVE", "OFF");` (for `target_os = "macos" && target_arch = "aarch64"`) just before the `config.build()` call. -- **Patch is fragile** — Resets on `cargo clean`, crate version bump, or registry re-download. Deleting build cache alone (`target/debug/build/whisper-rs-sys-*`) is NOT enough — cmake regenerates with the same bad flags. -- **Correct fix** — Needs an upstream patch in `whisper-rs-sys` or a Cargo feature to opt out of `GGML_NATIVE` on Apple Silicon cross-builds. - ## Environment - **Core sidecar port** — `7788` (default). Check with `lsof -i :7788`. diff --git a/app/src-tauri/Cargo.lock b/app/src-tauri/Cargo.lock index b4af2bb3c..0f0a9570d 100644 --- a/app/src-tauri/Cargo.lock +++ b/app/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "OpenHuman" -version = "0.51.2" +version = "0.51.4" dependencies = [ "env_logger", "log", diff --git a/app/src-tauri/build.rs b/app/src-tauri/build.rs index 9521e8c7e..7e8456982 100644 --- a/app/src-tauri/build.rs +++ b/app/src-tauri/build.rs @@ -1,6 +1,12 @@ use std::env; fn main() { + // Ensure Tauri ACL is regenerated when permissions or capabilities change. + // Without this, cargo incremental builds may skip tauri-build and embed + // stale ACL tables that miss newly added permission entries. + println!("cargo:rerun-if-changed=permissions"); + println!("cargo:rerun-if-changed=capabilities"); + maybe_override_tauri_config_for_local_builds(); tauri_build::build(); } diff --git a/app/src-tauri/permissions/allow-core-process.toml b/app/src-tauri/permissions/allow-core-process.toml index 013cc72c6..11912977f 100644 --- a/app/src-tauri/permissions/allow-core-process.toml +++ b/app/src-tauri/permissions/allow-core-process.toml @@ -1,6 +1,6 @@ [[permission]] identifier = "allow-core-process" -description = "Core RPC URL and sidecar restart" +description = "Core RPC URL, sidecar restart, and dictation hotkey commands" [permission.commands] allow = [ @@ -11,5 +11,7 @@ allow = [ "service_stop_direct", "service_status_direct", "service_uninstall_direct", + "register_dictation_hotkey", + "unregister_dictation_hotkey", ] deny = []