consciousness/src/user
Kent Overstreet dd551fe551 config: watch config.json5 with inotify, reload live on change
Both config halves (Config for the memory section, AppConfig globally)
are now reloaded whenever ~/.consciousness/config.json5 changes on
disk. So edits from vim, manual tweaks, or F6's own config_writer
calls all land without a restart. No more "reload the daemon to pick
up a config change."

Wires up the previously-unused Config::reload() (Kent flagged it as
"not dead, just not wired"). Pairs it with an AppConfig reload via
install_app(). Both run on the same file-change event.

Implementation:

- notify-debouncer-mini watches the config file's parent directory
  (editors usually replace-via-rename, so watching the file itself
  misses the new inode). Debounced at 200ms to coalesce the flurry
  of events editors produce around a single save.
- Filter for events whose path is the actual config file.
- On match: call reload() for Config, run build_figment + extract for
  AppConfig. If AppConfig parsing fails (editor mid-save with partial
  content), log and keep the old cached value.
- Watcher runs in its own named thread, fire-and-forget. If startup
  fails we just log and move on — worst case is no live reload, not
  a crash.

CliArgs + SubCmd both get Clone derives so the watcher can own a
snapshot of the startup args for future reloads. Watcher is kicked
off in user/mod.rs:start() right after load_session.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
2026-04-16 16:14:43 -04:00
..
chat.rs config: drop dead code and collapse to a single backend 2026-04-16 15:41:55 -04:00
context.rs config: drop dead code and collapse to a single backend 2026-04-16 15:41:55 -04:00
learn.rs learn: skip empty responses; show prior conversation context on F6 2026-04-16 13:20:03 -04:00
mod.rs config: watch config.json5 with inotify, reload live on change 2026-04-16 16:14:43 -04:00
scroll_pane.rs user: fix text selection on wrapped lines 2026-04-12 15:49:57 -04:00
selectable.rs selectable: silence unused method warning 2026-04-12 16:10:58 -04:00
subconscious.rs subconscious screen: show full context window 2026-04-12 01:45:10 -04:00
thalamus.rs thalamus: add thinking mode toggles (native + tool) 2026-04-14 18:25:00 -04:00
unconscious.rs user: remove dead scroll state from thalamus and unconscious screens 2026-04-11 01:35:15 -04:00
widgets.rs Display memory scores in status column 2026-04-15 06:08:27 -04:00