feat: --auto-watch flag to embed watcher inside MCP server process#130
feat: --auto-watch flag to embed watcher inside MCP server process#130Dhruv-Darji wants to merge 3 commits intotirth8205:mainfrom
Conversation
tirth8205
left a comment
There was a problem hiding this comment.
Interesting feature — embedding a file watcher inside the MCP server process. This is a significant addition (+657 lines) with PID/lock file management and daemon lifecycle.
A few concerns:
- Cross-platform PID handling needs careful testing (Windows, WSL).
- Lock file cleanup on crash — what happens if the process dies without cleaning up?
- This overlaps with the existing
watchcommand — how do they interact?
Please rebase on latest main and address these questions. We'll give it a thorough review once it's up to date.
00a8c74 to
efdf7f1
Compare
Review: PR #130 — feat: --auto-watch flag and daemon commandNeeds rebase and addressing open questions before merge. Code quality observations:
Please rebase on latest |
|
Status: BEHIND but not conflicting — this PR is mergeable but behind main. However, it should not be merged until the open questions from the owner's review are addressed: (1) cross-platform PID handling (WSL), (2) lock file cleanup on crash (try/finally in background thread), (3) clarification of interaction with the existing watch command. Please address these and rebase to bring the branch current with main. |
This pull request adds robust offline daemon support and improves the CLI and server integration for the code review graph tool. The main enhancements include a new
daemoncommand for managing a background filesystem watcher, improvedserve/mcpcommand wiring with optional auto-watch, and extensive internal refactoring for process management and status reporting. Comprehensive tests for the new CLI commands and daemon helpers are also included.CLI and Daemon Command Enhancements:
daemoncommand to the CLI for starting, stopping, and checking the status of an offline watch daemon, including support for foreground/background operation and status metadata. (code_review_graph/cli.py,code_review_graph/incremental.py) [1] [2] [3] [4]serveandmcpcommands with an--auto-watchflag, allowing the MCP server to run alongside a background file watcher. (code_review_graph/cli.py,code_review_graph/main.py) [1] [2] [3] [4]Daemon Process Management and Watcher Refactoring:
code_review_graph/incremental.py) [1] [2]code_review_graph/incremental.py)code_review_graph/incremental.py,code_review_graph/main.py) (Fa10b2a3L933, code_review_graph/main.pyL690-R714)Testing Improvements:
serve,mcp, and alldaemonsubcommands, as well as tests for the new daemon helpers and lock acquisition logic. (tests/test_cli.py,tests/test_incremental.py) [1] [2] [3]These changes make the tool more robust for offline and background operation, and provide a more user-friendly and scriptable interface for managing the file watcher and MCP server.