Skip to content

feat: Remove daemon from watch mode#12175

Merged
anthonyshew merged 1 commit intomainfrom
shew/remove-daemon-from-watch
Mar 6, 2026
Merged

feat: Remove daemon from watch mode#12175
anthonyshew merged 1 commit intomainfrom
shew/remove-daemon-from-watch

Conversation

@anthonyshew
Copy link
Contributor

Summary

Replaces the daemon gRPC IPC in turbo watch with in-process file watching. All watcher components are instantiated directly in WatchClient, eliminating the daemon as a dependency for watch mode.

  • Introduces OutputWatcher trait to abstract output change tracking, replacing DaemonClient in RunCache/TaskCache
  • Builds the full watcher stack in-process: FileSystemWatcherCookieWriterGlobWatcher + PackageWatcherHashWatcherPackageChangesWatcher
  • Pre-populates hash baselines at startup so build output writes don't trigger spurious rebuilds
  • Waits for active runs to complete before processing new change events, preventing concurrent builds of the same package
  • Makes TUI start_task resilient to out-of-order events from concurrent runs
  • Handles SIGINT as a clean exit (code 0) instead of propagating an error

The daemon is still used by other consumers (turbo daemon CLI, LSP, turbo info).

Testing

Manually verified on the turborepo monorepo (24 packages):

  • Initial build settles without spurious rebuilds
  • File edits during builds are not lost
  • Rapid successive edits are debounced
  • Same-content writes don't trigger rebuilds
  • Ctrl+C exits cleanly
  • TUI stays alive across rebuilds

Automated: 11 E2E tests, 18 watch unit tests, 8 OutputWatcher trait tests, 6 GlobWatcher delegation tests, 2 TUI start_task resilience tests — all passing.

@anthonyshew anthonyshew requested a review from a team as a code owner March 6, 2026 14:46
@anthonyshew anthonyshew requested review from tknickman and removed request for a team March 6, 2026 14:47
@vercel
Copy link
Contributor

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
examples-vite-web Building Building Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
turbo-site Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
turborepo-agents Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm
turborepo-test-coverage Ready Ready Preview, Comment, Open in v0 Mar 6, 2026 3:25pm

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

Coverage Report

Metric Coverage
Lines 85.22%
Functions 81.21%
Branches 0.00%

View full report

Replace the daemon gRPC IPC in turbo watch with in-process file watching
infrastructure. All watcher components (FileSystemWatcher, CookieWriter,
GlobWatcher, PackageWatcher, HashWatcher, PackageChangesWatcher) are
instantiated directly in WatchClient, eliminating the daemon dependency
for watch mode.

Key changes:
- Replace DaemonClient with OutputWatcher trait in RunCache/TaskCache
- Create InProcessOutputWatcher wrapping GlobWatcher
- Build full watcher stack in WatchClient::new()
- Pre-populate hash baselines at startup to prevent spurious rebuilds
- Wait for active runs to complete before processing new change events
- Make TUI start_task resilient to concurrent/out-of-order events
- Handle SIGINT as clean exit (exit code 0, no error message)

The daemon is still used by other consumers (turbo daemon CLI, LSP,
turbo info, diagnostics). This change only decouples watch mode.
@anthonyshew anthonyshew force-pushed the shew/remove-daemon-from-watch branch from 415b781 to 0d581ac Compare March 6, 2026 15:23
@anthonyshew anthonyshew merged commit 67ff6d2 into main Mar 6, 2026
52 of 53 checks passed
@anthonyshew anthonyshew deleted the shew/remove-daemon-from-watch branch March 6, 2026 15:35
github-actions bot added a commit that referenced this pull request Mar 6, 2026
## Release v2.8.15-canary.1

Versioned docs: https://v2-8-15-canary-1.turborepo.dev

### Changes

- release(turborepo): 2.8.14-canary.9 (#12173) (`27e8e67`)
- release(turborepo): 2.8.14 (#12174) (`5e8fe42`)
- feat: Remove daemon from watch mode (#12175) (`67ff6d2`)

---------

Co-authored-by: Turbobot <turbobot@vercel.com>
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