Expand description
Filesystem watcher for files open in editor/preview panes — detects
external changes (an agent’s Edit/Write tool, another process, a
second AgentMux window) and pushes a per-block “this file changed on
disk” wake signal so panes can refresh instead of silently going stale.
Migrated onto the shared fs_watch::FsWatchPool
(SPEC_SHARED_FS_WATCHER_FRAMEWORK_2026_08_07.md) — this module keeps only
its own domain-specific bookkeeping (which block ids have which paths
open, per-path debounce, and the EVENT_EDITOR_FILE_CHANGED publish
shape). The actual notify construction, OS-level watch/unwatch, and
recovery-on-failure now live in the pool, shared with every other
watcher that migrates onto it (config_watcher_fs.rs already has;
media_file_watcher.rs, below in the same PR, is the directory-mode
sibling migrating alongside this one).
Spec: docs/specs/SPEC_EDITOR_LIVE_FILE_RELOAD_2026_07_18.md
Structs§
Constants§
- DEBOUNCE 🔒
- EVENT_
EDITOR_ FILE_ CHANGED - MPS event fired when a file open in at least one editor tab changes on
disk. Scoped per-block (
block:<id>) viaMuxEvent::scopes, matchingEVENT_CONTROLLER_STATUS/EVENT_BLOCK_ACTIVITY’s existing pattern — never a global broadcast, so panes on unrelated files aren’t notified. Payload is deliberately just the path (a wake signal, not content); the frontend re-fetches via the existingreadeditorfileRPC.
Functions§
- publish_
editor_ 🔒file_ changed - Publish
EVENT_EDITOR_FILE_CHANGED, scoped to every block that has a tab open onpath. Mirrorspublish_block_activity’s per-block scoping (crates/srv/src/backend/mps.rs) — not a global broadcast.
Type Aliases§
- Debounce
Gens 🔒 - Per-path debounce generation counters. A new fs event for a path bumps its counter; the delayed publish task only fires if its captured generation is still current when its sleep completes, so a burst of writes (e.g. an editor’s multi-syscall save) collapses into one event.