feat: --auto-watch flag to embed watcher inside MCP server process (conflict-resolved)#368
Open
feat: --auto-watch flag to embed watcher inside MCP server process (conflict-resolved)#368
Conversation
Merged PR #130 (feat: --auto-watch flag to embed watcher inside MCP server process) with main. Kept both sides' changes: - cli.py: added --auto-watch/mcp alias alongside existing --http/--tools/--host/--port - main.py: merged auto_watch param + watch_store lifecycle into full transport-aware main() - incremental.py: kept on_files_updated callback from main + lock/daemon helpers from PR - embeddings.py: kept both typing.cast and urllib.parse.urlparse imports - tests: kept both test classes from each side Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves the merge conflicts from PR #130 (originally from @Dhruv-Darji) and brings in the
--auto-watchfeature cleanly on top ofmain.Original PR: #130 by @Dhruv-Darji
Changes from PR #130 (preserved):
serve --auto-watch/mcp --auto-watchflag to start filesystem watcher in a background daemon thread while MCP server runsmcpcommand as an alias forservewatchcommand now raisesRuntimeErrorand exits with code 1 when watcher lock is already held (e.g. daemon running)start_watch_thread()helper inincremental.pyfor embedding watcher in MCP process_acquire_watch_lock,_release_watch_lock,start_watch_daemon,stop_watch_daemon,get_watch_daemon_status)TestServeCommand,TestDaemonCommand,TestWatchInteractionintest_cli.py;TestWatchDaemonintest_incremental.pyConflict resolution:
cli.py: merged--auto-watchandmcpalias alongside existing--http/--tools/--host/--portflagsmain.py: mergedauto_watchparam + watch store lifecycle into the full transport-awaremain()function (keeping--http,--tools, Windows event loop fix)incremental.py: kepton_files_updatedcallback frommain+ all lock/daemon helpers from PRembeddings.py: kept bothtyping.cast(from PR) andurllib.parse.urlparse(from main)Test plan
uv run pytest tests/test_cli.py tests/test_incremental.py -vuv run code-review-graph serve --auto-watchstarts MCP server with background watcheruv run code-review-graph mcp --auto-watchworks as aliasuv run code-review-graph serve --http --port 5555still worksuv run code-review-graph daemon start/stop/statusworkuv run code-review-graph watchexits with error when daemon is runningCloses #130
🤖 Generated with Claude Code