Skip to content

fix: disable Electron file watchers - #151

Merged
regnull merged 1 commit into
mainfrom
fix/disable-electron-file-watching
Sep 25, 2026
Merged

regnull merged 1 commit into
mainfrom
fix/disable-electron-file-watching

Conversation

@regnull

@regnull regnull commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Problem

Electron development launched both Uvicorn reload watchers and Vite's file watcher. Repository changes—including activity in unrelated worktrees, .venv, or frontend dependency trees—could trigger expensive watcher work and freeze the Electron UI while a message was being sent. The intended behavior is restart-to-update for Electron.

Solution

  • Removed --reload and --reload-dir from the Electron backend launcher.
  • Added an Electron-only ELECTRON_DEV=1 mode and configure Vite with server.watch: null in that mode.
  • Kept the normal browser/Vite development flow unchanged, including its existing proxy and backend behavior.
  • Added regression assertions that Electron launch commands contain no reload flags and that the Electron Vite configuration disables watching.

Users can restart the Electron app to pick up source changes; message sending, API routing, readiness checks, and explicit app behavior remain unchanged.

Changed files

File Change
scripts/electron-dev.sh Run Electron's backend without Uvicorn reload and mark its Vite process as Electron development.
frontend/vite.config.ts Disable Vite file watching only when ELECTRON_DEV=1.
frontend/electron/main.test.ts Add regression coverage for disabled backend/frontend watching.

Root cause

The Electron launcher enabled two independent file-change update mechanisms: Uvicorn's --reload process and Vite's development watcher. Those watchers monitored repository files while the Electron UI was active; large or unrelated repository changes could consume resources and interfere with normal message interaction.

Verification

  • make lint — passed (7 pre-existing Oxlint warnings, 0 errors).
  • make test — passed: 457 backend tests; frontend Vitest and typecheck passed.
  • make build — passed.
  • Focused pnpm vitest run electron/main.test.ts — 12 tests passed.
  • bash -n scripts/electron-dev.sh and git diff --check — passed.

Related conventions

The browser make dev workflow retains live development behavior. Only the Electron launcher is restart-to-update, as requested.

@regnull regnull left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed PR #151 against the pushed diff. The Electron-only Vite environment flag is scoped to the launcher, normal browser development retains its watcher, and backend reload is removed only from the Electron launcher. The existing dedicated ports/proxy and process-group cleanup remain consistent. The added regression coverage verifies the key source-level wiring.

No correctness blockers found. Ready to merge after QA confirms the reported checks.

— Reviewer - @Reviewer

@regnull
regnull merged commit 16fe0c3 into main Sep 25, 2026
4 checks passed
@regnull
regnull deleted the fix/disable-electron-file-watching branch September 25, 2026 16:29
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