Skip to content

refactor(tauri): reduce desktop host to sidecar lifecycle + deep-link - #84

Merged
senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:fix/cleanup-tauri
Mar 30, 2026
Merged

senamakel merged 3 commits into
tinyhumansai:mainfrom
senamakel:fix/cleanup-tauri

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

  • Trims app/src-tauri down to a thin desktop host that only handles sidecar lifecycle and deep-link plumbing.
  • Removes Tauri-side RPC relay, daemon-host config commands, AI preview commands, health event bridge, and window wrapper commands.
  • Removes heavy/unused Tauri Rust dependencies (including reqwest) and updates capabilities accordingly.
  • Moves daemon health updates and window control behavior to frontend-side APIs/core RPC.
  • Adds daemon-host config read/write to core openhuman.service_* RPC so frontend can call through core directly.

Problem

  • The Tauri host had accumulated product logic (AI preview parsing, daemon host config persistence, service bootstrap/relay behavior, health event emission).
  • This duplicated behavior that belongs in core/frontend layers, increased dependency surface, and violated the intended wrapper-only architecture.

Solution

  • Reworked app/src-tauri/src/lib.rs to keep only:
    • deep-link plugin registration
    • core sidecar startup/shutdown
    • core_rpc_url command for frontend base URL resolution
  • Removed obsolete modules under app/src-tauri/src/commands, core_rpc.rs, and utils.
  • Updated sidecar readiness checks to use lightweight TCP port probing (tokio::net::TcpStream) instead of HTTP reqwest ping.
  • Frontend changes:
    • daemonHealthService now polls openhuman.health_snapshot via callCoreRpc instead of listening to Tauri-emitted openhuman:health events.
    • Deep-link flow focuses window via @tauri-apps/api/window instead of Rust invoke command.
    • Window/service/daemon-host paths in tauriCommands.ts now use frontend APIs or direct core RPC.
  • Core changes:
    • Added openhuman.service_daemon_host_get / openhuman.service_daemon_host_set handlers in service schemas/ops.

Submission Checklist

  • Unit tests — Existing type/system checks run for touched areas (yarn typecheck, cargo check root + app/src-tauri)
  • E2E / integration — Not run in this PR; recommend targeted desktop E2E coverage for daemon/service panel + deep-link flows
  • N/A —
  • Doc comments — Existing module/function docs retained; new core service handlers are straightforward and colocated in existing modules
  • Inline comments — Added/kept where edge behavior is non-obvious (startup checks and health polling expectations)

Impact

  • Platform/runtime: desktop host behavior is simplified; business logic remains in core/frontend.
  • Dependency footprint: reduced Rust dependencies and plugin permissions in app/src-tauri.
  • Compatibility: frontend no longer depends on removed Rust invoke commands for service/daemon-host/window paths.
  • Risk: daemon/service UX depends on core RPC availability; if sidecar startup is delayed, frontend polling gracefully times out to disconnected state.

Related

  • Issue(s): N/A
  • Follow-up PR(s)/TODOs:
    • Replace remaining legacy invoke(...) paths in frontend (exchange_token, conscious_loop_run, runtime_*) with direct core RPC or frontend-native APIs where appropriate.
    • Fix .husky/pre-push to re-check after auto-fix (currently fails if initial format/lint fails even when fixed).

…arding flow

- Added DEV_FORCE_ONBOARDING configuration to bypass onboarding checks during development.
- Updated onboarding logic in AppRoutes to respect the new flag, ensuring onboarding is always shown when enabled.
- Introduced new utility functions for managing onboarding state based on the flag.
- Updated Cargo.lock and Cargo.toml to reflect dependency changes and version updates.
- Removed deprecated openhuman command module and refactored related functionalities into daemon_host module for better organization.
- Updated DaemonHealthService to use polling via `openhuman.health_snapshot` instead of event listening for health updates.
- Introduced a new focusMainWindow function to centralize window focus logic across deep link handling and Tauri commands.
- Replaced `invoke` calls with direct window management methods for showing, hiding, and toggling the main window.
- Removed deprecated core_rpc module and related commands for improved organization and clarity.
- Updated Cargo.toml and Cargo.lock to reflect dependency changes.
…bject structure

- Moved the import of `callCoreRpc` to a more appropriate location in DaemonHealthService.
- Simplified the structure of the tools object in the aiGetConfig function for better readability.
- Ensured consistency in Tauri command invocations by removing unnecessary line breaks.
@senamakel
senamakel merged commit 36fc5bd into tinyhumansai:main Mar 30, 2026
3 of 6 checks passed
@senamakel
senamakel deleted the fix/cleanup-tauri branch March 30, 2026 18:41
@senamakel
senamakel restored the fix/cleanup-tauri branch March 30, 2026 19:12
@senamakel
senamakel deleted the fix/cleanup-tauri branch March 31, 2026 00:55
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
chore: merge develop into main (v0.37.0)
AusAgentSmith pushed a commit to AusAgentSmith/openhuman that referenced this pull request May 23, 2026
…tinyhumansai#84)

* feat(onboarding): introduce DEV_FORCE_ONBOARDING flag to control onboarding flow

- Added DEV_FORCE_ONBOARDING configuration to bypass onboarding checks during development.
- Updated onboarding logic in AppRoutes to respect the new flag, ensuring onboarding is always shown when enabled.
- Introduced new utility functions for managing onboarding state based on the flag.
- Updated Cargo.lock and Cargo.toml to reflect dependency changes and version updates.
- Removed deprecated openhuman command module and refactored related functionalities into daemon_host module for better organization.

* feat(daemon): refactor daemon health monitoring and window management

- Updated DaemonHealthService to use polling via `openhuman.health_snapshot` instead of event listening for health updates.
- Introduced a new focusMainWindow function to centralize window focus logic across deep link handling and Tauri commands.
- Replaced `invoke` calls with direct window management methods for showing, hiding, and toggling the main window.
- Removed deprecated core_rpc module and related commands for improved organization and clarity.
- Updated Cargo.toml and Cargo.lock to reflect dependency changes.

* refactor(daemonHealthService): streamline imports and simplify tool object structure

- Moved the import of `callCoreRpc` to a more appropriate location in DaemonHealthService.
- Simplified the structure of the tools object in the aiGetConfig function for better readability.
- Ensured consistency in Tauri command invocations by removing unnecessary line breaks.
YOMXXX added a commit to YOMXXX/openhuman that referenced this pull request May 27, 2026
Blockers:
- Switch `memoryTreePipelineStatus` and `memoryTreeSetEnabled` from
  `invoke('core_rpc_relay', ...)` back to `callCoreRpc`. The
  `core_rpc_relay` Tauri command was removed in tinyhumansai#84 and is not
  registered in the shell — the previous commit that switched to it
  was incorrect and would cause runtime failures on every call.

Doc drift:
- Update `wiki_size_bytes` comment in both TS interface and Rust
  schema to say "wiki/ sub-tree" instead of "content root",
  matching the actual walk scope since commit 65526ce.

Cleanup:
- Remove empty `<div className="flex items-center gap-3" />` from
  Intelligence.tsx — the status pills it hosted moved into
  `MemoryTreeStatusPanel` in tinyhumansai#1856 Part 1.
- Remove unused `invoke` import from memoryTree.ts.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
YOMXXX added a commit to YOMXXX/openhuman that referenced this pull request May 27, 2026
Blockers:
- Switch `memoryTreePipelineStatus` and `memoryTreeSetEnabled` from
  `invoke('core_rpc_relay', ...)` back to `callCoreRpc`. The
  `core_rpc_relay` Tauri command was removed in tinyhumansai#84 and is not
  registered in the shell — the previous commit that switched to it
  was incorrect and would cause runtime failures on every call.

Doc drift:
- Update `wiki_size_bytes` comment in both TS interface and Rust
  schema to say "wiki/ sub-tree" instead of "content root",
  matching the actual walk scope since commit 65526ce.

Cleanup:
- Remove empty `<div className="flex items-center gap-3" />` from
  Intelligence.tsx — the status pills it hosted moved into
  `MemoryTreeStatusPanel` in tinyhumansai#1856 Part 1.
- Remove unused `invoke` import from memoryTree.ts.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
senamakel added a commit to nocstah/openhuman that referenced this pull request Sep 11, 2026
senamakel added a commit to nocstah/openhuman that referenced this pull request Sep 11, 2026
…tinyhumansai#84)\n\n* feat(onboarding): introduce DEV_FORCE_ONBOARDING flag to control onboarding flow\n\n- Added DEV_FORCE_ONBOARDING configuration to bypass onboarding checks during development.\n- Updated onboarding logic in AppRoutes to respect the new flag, ensuring onboarding is always shown when enabled.\n- Introduced new utility functions for managing onboarding state based on the flag.\n- Updated Cargo.lock and Cargo.toml to reflect dependency changes and version updates.\n- Removed deprecated openhuman command module and refactored related functionalities into daemon_host module for better organization.\n\n* feat(daemon): refactor daemon health monitoring and window management\n\n- Updated DaemonHealthService to use polling via `openhuman.health_snapshot` instead of event listening for health updates.\n- Introduced a new focusMainWindow function to centralize window focus logic across deep link handling and Tauri commands.\n- Replaced `invoke` calls with direct window management methods for showing, hiding, and toggling the main window.\n- Removed deprecated core_rpc module and related commands for improved organization and clarity.\n- Updated Cargo.toml and Cargo.lock to reflect dependency changes.\n\n* refactor(daemonHealthService): streamline imports and simplify tool object structure\n\n- Moved the import of `callCoreRpc` to a more appropriate location in DaemonHealthService.\n- Simplified the structure of the tools object in the aiGetConfig function for better readability.\n- Ensured consistency in Tauri command invocations by removing unnecessary line breaks.\n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant