Skip to content

CE: Embed worker daemon in desktop app#287

Merged
ericflo merged 2 commits intomainfrom
ce/embed-worker-daemon
Apr 15, 2026
Merged

CE: Embed worker daemon in desktop app#287
ericflo merged 2 commits intomainfrom
ce/embed-worker-daemon

Conversation

@ericflo
Copy link
Copy Markdown
Owner

@ericflo ericflo commented Apr 15, 2026

What

Wire up modelrelay-worker as embedded library in the Tauri desktop app. Replace stub Tauri commands with real WorkerManager that starts/stops WorkerDaemon, persists settings to disk, and tracks live connection status.

Why

Goal 2 of the Desktop/Tray App project: worker must run as embedded Rust library, not subprocess.

Changes

  • WorkerManager struct in lib.rs with start/stop/status lifecycle via Arc<Mutex<_>> shared state
  • Worker daemon runs in a background tokio task, stoppable via abort()
  • Settings persistence to JSON file in Tauri app data directory
  • Real Tauri commands (get_status, get_settings, save_settings, start_worker, stop_worker) backed by managed state
  • Auto-start on launch when auto_start is enabled and worker secret is configured
  • save_settings auto-restarts the worker if it was running (picks up new config)
  • AppStatus now includes error field for surfacing daemon failures to the frontend

@ericflo ericflo merged commit 51a7429 into main Apr 15, 2026
12 checks passed
@ericflo ericflo deleted the ce/embed-worker-daemon branch April 15, 2026 04:16
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