Skip to content

feat(daemon): shared detached daemon with live file-watch incremental re-index#41

Merged
sunerpy merged 29 commits into
mainfrom
feat/live-watch-daemon
Jun 25, 2026
Merged

feat(daemon): shared detached daemon with live file-watch incremental re-index#41
sunerpy merged 29 commits into
mainfrom
feat/live-watch-daemon

Conversation

@sunerpy

@sunerpy sunerpy commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

Introduce a shared, detached background daemon for codegraph serve --mcp with a live file watcher that incrementally re-indexes the project on change — so multiple agent clients share one daemon and the index auto-updates without a manual index run.

Daemon / proxy / watch

  • Spawn the shared daemon as a truly detached background process; launcher decision order (CODEGRAPH_NO_DAEMON / internal / no-.codegraph/ / spawn-or-proxy).
  • One project watcher per daemon, shared across clients; proxy mode pipes the local handshake to the shared daemon.
  • Background catch-up sync on open (non-blocking first call); idle-linger + max-idle backstop; dead-client pid sweep.
  • Direct serve mode also runs an in-process watcher.
  • Clean degradation on watch-resource exhaustion with bounded backoff.

Config & hooks

  • Map custom file extensions to languages via .codegraph/codegraph.json.
  • prompt-hook subcommand + opt-in Claude front-load installer hook.

Fixes / polish

  • fix(mcp): reopen the cached engine when its DB is replaced on disk.
  • perf(daemon): wake the proxy ppid watchdog via condvar instead of poll-sleep.
  • refactor(watch): derive the deleted-source check from builtin_language_for_ext; report the real crate version in MCP serverInfo.

Docs

  • Document the daemon/watch live-update model, codegraph.json, env vars, and prompt-hook (README + docs/cli.md + docs/mcp.md + architecture.md + zh-CN README).

Verification

  • make ci green locally (fmt + clippy -D warnings + full test + guardrail).
  • Golden byte-stability preserved (golden_mcp / equivalence / resolution suites pass).
  • Hands-on E2E: shared daemon spawn, live incremental re-index (~0.6s, Auto-synced after edit), idle-exit, prompt-hook.

sunerpy added 29 commits June 24, 2026 16:11
…r_ext; report real crate version in MCP serverInfo
@sunerpy sunerpy merged commit ee9de19 into main Jun 25, 2026
4 checks passed
@sunerpy sunerpy deleted the feat/live-watch-daemon branch June 25, 2026 00:24
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