-
Notifications
You must be signed in to change notification settings - Fork 168
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Problem
bm watch can remain alive but stop indexing filesystem changes after long uptime (seen overnight on macOS).
This creates a silent failure mode for downstream tools: files exist on disk, but search/read by permalink and graph traversal lag indefinitely until manual watcher restart.
Related downstream issue: basicmachines-co/openclaw-basic-memory#15
Why this looks upstream
openclaw-basic-memory only spawns bm watch; it does not own file watching internals. The watch loop and restart behavior live in:
src/basic_memory/sync/watch_service.pysrc/basic_memory/cli/commands/watch.py
Reproduction (observed)
- Run
bm watch --project <name>. - Leave running for several hours.
- Create/modify markdown files under project path.
- Process is still alive, but changes are not indexed until watcher is restarted.
Requested fix
Add explicit stale-watch self-healing and diagnostics in the watch service:
- Add a heartbeat timestamp in watch status (updated even when no file events occur).
- Detect stale cycles (watch loop alive but no event processing/heartbeat progress for configurable window).
- Force a clean watch cycle restart and emit a structured warning when staleness is detected.
- Expose staleness counters/last-restart reason in watch status JSON for monitoring.
Acceptance criteria
- Long-running watcher recovers automatically from stale state without manual restart.
~/.basic-memory/watch_status.jsonincludes heartbeat + last restart reason.- A synthetic integration test reproduces stale cycle handling (or equivalent deterministic test harness around watch loop restart logic).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request