Skip to content

Fix plugins lost after server restart in desktop app#435

Merged
yondonfu merged 2 commits intomainfrom
yf/desktop-app-install-fixes
Feb 10, 2026
Merged

Fix plugins lost after server restart in desktop app#435
yondonfu merged 2 commits intomainfrom
yf/desktop-app-install-fixes

Conversation

@yondonfu
Copy link
Copy Markdown
Contributor

@yondonfu yondonfu commented Feb 10, 2026

Summary

Fixes #425 — Plugins install successfully but disappear after server restart in the Electron desktop app.

Root cause: Two issues combine to wipe installed plugins:

  1. The NSIS Windows installer downloads the latest uv release instead of the pinned 0.9.11. This version mismatch triggers an unnecessary uv sync on first launch that removes the entire venv.
  2. uv run (used to spawn the server) does an implicit sync that destroys and recreates the venv on every start and respawn, wiping all plugin packages.

Confirmed from reporter's logs: Loaded 0 plugin(s) on every single startup across months, with Removed virtual environment at: on every uv run respawn.

Changes:

  • Pin uv version in NSIS installer (app/build/win/installer.nsh) — Download 0.9.11 specifically instead of latest, matching UV_VERSION in config.ts
  • Add --no-sync to uv run (app/src/services/pythonProcess.ts) — Prevent implicit venv sync on server start/respawn. Safe because uv sync already runs explicitly during Electron setup
  • Use --inexact on uv sync (app/src/services/setup.ts) — When setup does run, preserve extra packages (plugins) not in the lockfile

Test plan

  • Build Windows installer (npm run dist:win) and verify downloaded uv is 0.9.11
  • Install a plugin, verify it persists after managed restart (exit code 42)
  • Fully close and reopen the app — verify plugins still load
  • Verify uv run daydream-scope --no-browser still works standalone

🤖 Generated with Claude Code

yondonfu and others added 2 commits February 10, 2026 17:44
The NSIS installer was missing UV_PROJECT_ENVIRONMENT when running
uv sync, causing it to create the venv in the wrong location. Also
adds --inexact to preserve plugin packages, copies patches.pth, and
checks for venv existence in isSetupNeeded() since uv run now uses
--no-sync.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Yondon Fu <[email protected]>
@yondonfu yondonfu merged commit 6d504dc into main Feb 10, 2026
6 checks passed
@yondonfu yondonfu deleted the yf/desktop-app-install-fixes branch February 10, 2026 23:19
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.

Plugin Installation Not Working

1 participant