From e925e8a3191416cb261ef4f817fc764db00695f1 Mon Sep 17 00:00:00 2001
From: Steven Enamakel <31011319+senamakel@users.noreply.github.com>
Date: Sat, 4 Apr 2026 20:26:08 -0700
Subject: [PATCH] Fix local reset flow and Accessibility permission handling
(#324)
* refactor: clean up imports and improve code structure in skills_cli and registry_ops
- Removed unused imports in `skills_cli.rs` and `registry_ops.rs` to enhance code clarity.
- Streamlined import statements for better organization and readability.
- Minor adjustments in `engine.rs` to maintain consistency in import usage.
* fix: update UI text and styles for MemoryWorkspace and SkillSetupWizard components
- Changed the title in MemoryWorkspace to "Memory (EverMind)" for clarity.
- Updated text colors in SkillSetupWizard for better visibility and consistency.
- Enhanced button styles and loading indicators for improved user experience.
* feat: implement reset functionality for OpenHuman data and enhance app data clearing process
- Added a new utility function `resetOpenHumanDataAndRestartCore` to reset local OpenHuman data and restart the core process.
- Updated `clearAllAppData` in `SettingsHome` to utilize the new reset function, improving the app's data clearing process.
- Enhanced error handling during the data reset and session clearing operations to ensure robustness.
- Introduced tests for the new reset functionality to validate its behavior and integration.
* refactor: remove screen recording permission from AccessibilityPanel
- Eliminated the screen recording permission check and associated UI elements from the AccessibilityPanel component.
- Updated tests to ensure the screen recording option is no longer present in the rendered output, improving clarity and focus on relevant permissions.
* chore: update package.json files to integrate Husky for Git hooks
- Added Husky as a dev dependency in both package.json files to manage Git hooks.
- Included "prepare" and "postinstall" scripts in the main package.json to ensure Husky is set up correctly.
- Cleaned up the app's package.json by removing the "prepare" script, as it is now handled in the main package.json.
- Enhanced logging in tauriCommands.ts for better debugging during the reset process.
* fix: update variable name for clarity in ops.rs test assertions
- Changed the variable name from `data` to `value` in the test assertions to enhance clarity and better reflect its purpose.
- Ensured that the assertions remain functional and maintain the integrity of the test logic.
* feat: enhance skill selection logic in skills_debug_e2e.rs
- Introduced a new function `select_skill_id` to improve skill selection based on environment variables and preferred skills.
- Updated the skill ID retrieval process to prioritize user-defined skills while maintaining a fallback to the default skill.
- Enhanced documentation to clarify the usage of environment variables for skill testing.
* format
---
app/package.json | 3 +-
app/src-tauri/src/core_process.rs | 12 +-
app/src-tauri/src/lib.rs | 9 +-
.../intelligence/MemoryWorkspace.tsx | 2 +-
app/src/components/settings/SettingsHome.tsx | 23 ++--
.../settings/panels/AccessibilityPanel.tsx | 14 +-
.../__tests__/AccessibilityPanel.test.tsx | 1 +
.../components/skills/SkillSetupWizard.tsx | 32 ++---
app/src/utils/__tests__/tauriCommands.test.ts | 12 +-
app/src/utils/tauriCommands.ts | 16 +++
package.json | 5 +
src/core/skills_cli.rs | 2 -
src/openhuman/config/ops.rs | 125 +++++++++++++++++-
src/openhuman/config/schemas.rs | 17 +++
src/openhuman/screen_intelligence/engine.rs | 4 +-
src/openhuman/screen_intelligence/ops.rs | 2 +-
src/openhuman/screen_intelligence/schemas.rs | 5 +-
src/openhuman/skills/registry_ops.rs | 6 +-
src/openhuman/subconscious/engine.rs | 4 +-
tests/skills_debug_e2e.rs | 60 ++++++++-
20 files changed, 279 insertions(+), 75 deletions(-)
diff --git a/app/package.json b/app/package.json
index b12ce86d4..ada29e1f8 100644
--- a/app/package.json
+++ b/app/package.json
@@ -40,8 +40,7 @@
"format": "prettier --write . && cargo fmt --manifest-path ../Cargo.toml --all",
"format:check": "prettier --check . && cargo fmt --manifest-path ../Cargo.toml --all --check",
"lint": "eslint . --ext .ts,.tsx",
- "lint:fix": "eslint . --ext .ts,.tsx --fix",
- "prepare": "husky"
+ "lint:fix": "eslint . --ext .ts,.tsx --fix"
},
"dependencies": {
"@heroicons/react": "^2.2.0",
diff --git a/app/src-tauri/src/core_process.rs b/app/src-tauri/src/core_process.rs
index 1cc9c78be..cc3c7fd53 100644
--- a/app/src-tauri/src/core_process.rs
+++ b/app/src-tauri/src/core_process.rs
@@ -208,7 +208,10 @@ impl CoreProcessHandle {
);
self.shutdown().await;
- log::debug!("[core] restart: shutdown complete, checking port {}", self.port);
+ log::debug!(
+ "[core] restart: shutdown complete, checking port {}",
+ self.port
+ );
// If we never spawned the sidecar (something else was already listening), we cannot free
// the port — fail fast with a clear message instead of polling for 8s.
@@ -265,12 +268,7 @@ impl CoreProcessHandle {
}
// Wait for the process to exit so the RPC listen socket is released before restart
// checks the port (otherwise we can spuriously hit "port still in use").
- match timeout(
- Duration::from_secs(12),
- child.wait(),
- )
- .await
- {
+ match timeout(Duration::from_secs(12), child.wait()).await {
Ok(Ok(status)) => {
log::debug!("[core] child core process reaped after kill: {status}");
}
diff --git a/app/src-tauri/src/lib.rs b/app/src-tauri/src/lib.rs
index b04a2268d..2292ad43e 100644
--- a/app/src-tauri/src/lib.rs
+++ b/app/src-tauri/src/lib.rs
@@ -143,10 +143,7 @@ async fn restart_core_process(
/// Register (or re-register) the global dictation toggle hotkey.
/// Emits `dictation://toggle` to all webviews when the shortcut is pressed.
#[tauri::command]
-async fn register_dictation_hotkey(
- app: AppHandle,
- shortcut: String,
-) -> Result<(), String> {
+async fn register_dictation_hotkey(app: AppHandle, shortcut: String) -> Result<(), String> {
log::info!("[dictation] register_dictation_hotkey: shortcut={shortcut}");
let old_shortcuts = {
@@ -189,7 +186,9 @@ async fn register_dictation_hotkey(
);
}
}
- return Err(format!("Failed to unregister previous shortcut '{old}': {e}"));
+ return Err(format!(
+ "Failed to unregister previous shortcut '{old}': {e}"
+ ));
}
unregistered_old.push(old.clone());
}
diff --git a/app/src/components/intelligence/MemoryWorkspace.tsx b/app/src/components/intelligence/MemoryWorkspace.tsx
index f0a14f98c..7bd617f04 100644
--- a/app/src/components/intelligence/MemoryWorkspace.tsx
+++ b/app/src/components/intelligence/MemoryWorkspace.tsx
@@ -350,7 +350,7 @@ export function MemoryWorkspace({ onToast }: MemoryWorkspaceProps) {
-
Memory
+
Memory (EverMind)
Your AI's knowledge graph, extracted insights, and ingestion activity.
diff --git a/app/src/components/settings/SettingsHome.tsx b/app/src/components/settings/SettingsHome.tsx
index d0987c850..2ae416baa 100644
--- a/app/src/components/settings/SettingsHome.tsx
+++ b/app/src/components/settings/SettingsHome.tsx
@@ -3,6 +3,7 @@ import { useState } from 'react';
import { skillManager } from '../../lib/skills/manager';
import { useCoreState } from '../../providers/CoreStateProvider';
import { persistor } from '../../store';
+import { resetOpenHumanDataAndRestartCore } from '../../utils/tauriCommands';
import SettingsHeader from './components/SettingsHeader';
import SettingsMenuItem from './components/SettingsMenuItem';
import { useSettingsNavigation } from './hooks/useSettingsNavigation';
@@ -29,29 +30,31 @@ const SettingsHome = () => {
};
const clearAllAppData = async () => {
- try {
- await setOnboardingCompletedFlag(false);
- } catch (err) {
- console.warn('[Settings] Failed to clear onboarding_completed in config:', err);
- }
try {
await clearSession();
} catch (err) {
console.warn('[Settings] Rust logout failed during clearAllAppData:', err);
}
- await persistor.purge();
- window.localStorage.clear();
- window.sessionStorage.clear();
+ try {
+ await resetOpenHumanDataAndRestartCore();
+ } catch (err) {
+ console.warn('[Settings] Failed to reset OpenHuman data dir and restart core:', err);
+ throw err;
+ }
- // NEW: Clear skills databases (emails, chats, cached files)
+ // Best-effort cleanup for in-memory and browser-side caches that live outside the Rust core.
try {
await skillManager.clearAllSkillsData();
} catch (error) {
console.warn('Failed to clear skills data:', error);
- // Continue with logout even if skills clearing fails
+ // Continue even if skill cleanup fails because the backend reset already completed.
}
+ await persistor.purge();
+ window.localStorage.clear();
+ window.sessionStorage.clear();
+
// Complete reset - redirect to login for fresh start
window.location.hash = '/';
};
diff --git a/app/src/components/settings/panels/AccessibilityPanel.tsx b/app/src/components/settings/panels/AccessibilityPanel.tsx
index 94de6785b..6b58ab7e4 100644
--- a/app/src/components/settings/panels/AccessibilityPanel.tsx
+++ b/app/src/components/settings/panels/AccessibilityPanel.tsx
@@ -85,7 +85,6 @@ const AccessibilityPanel = () => {
}, [dispatch]);
const anyPermissionDenied =
- status?.permissions.screen_recording === 'denied' ||
status?.permissions.accessibility === 'denied' ||
status?.permissions.input_monitoring === 'denied';
@@ -119,10 +118,6 @@ const AccessibilityPanel = () => {
{waiting
? "Waiting for authorization. Complete the login in your browser..."
: `Sign in with your ${providerName} account to connect this skill.`}
@@ -684,9 +684,9 @@ function OAuthLoginView({
{/* Login button or waiting state */}
{waiting ? (
-
+
-
+
Waiting for {providerName} authorization...
@@ -743,7 +743,7 @@ function OAuthLoginView({
@@ -796,7 +796,7 @@ function ProviderIcon({ provider }: { provider: string }) {
);
case "github":
return (
-