Repository navigation
fix: watch explicit MCP index targets - #2737
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
Signed-off-by: wargloom <wargloom@gmail.com>
9197e80 to
0325d6a
Compare
Match canonical Windows separators across watch ownership and admission, drain all session watches when auto_watch is disabled, and retain the resolved doc_candidates choice for later refreshes. Add deterministic regressions for the five observed failures and an absent-option guard. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for implementing session-owned watches and adding the ownership tests! I added two maintainer commits to finish the agreed behavior and get this onto the current CI baseline:
Validation: 191 targeted daemon/application/watcher tests passed on macOS arm64 with ASan/UBSan. The five reproduced failures returned when the production fix was reverted with the regression tests unchanged. The baseline merge left the validated production/test files byte-identical. Native Windows verification will come from the fresh required GitHub CI; I have not run a native Windows test locally. Thanks again for the contribution! I will check the refreshed CI before taking the next merge decision. |
|
Merged - thank you, @WarGloom! Separating each session's watch memberships from the physical watches was exactly the right shape, and your ownership tests (failed index, one-shot CLI, async requester disconnect, cancelled sync join) made the async lifetime straightforward to verify. With the two follow-up commits on top, CI is green on every platform, including the native Windows leg that exercises the path matching. Thanks again for the careful reproduction in #2733. |
…ndex-cpu main moved 12 merges past this branch's last base (72c3604). One conflict, in src/daemon/application.c: DeusData#2737 split application_background_index() into admit/wait helpers and gave it named result codes. Resolved by taking main's structure and keeping this branch's one change there: the automatic job's args carry _cbm_background after the policy call. The watcher path re-encodes mode/persistence/doc_candidates into the same document, so the marker survives the re-encode, and the job comparison still drops it. The net diff against main is unchanged: the same 13 files and the same added and removed lines as before the merge. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
What does this PR do?
Fixes #2733. With
auto_watch=true, a successfulindex_repositoryrequest from an initialized MCP session now registers the requested project and root for automatic refresh. A client started in a workspace can index a custom-named worktree and keep it fresh while that client remains connected. Previously that target reportedwatched: falsewithreason: not_session_projectafter a successful index.Track each session's memberships separately from physical watches. Shared projects remain watched until their last owner disconnects. Async completion registers a target only while a requesting session is connected; failed jobs and one-shot CLI requests do not add watches. Preserve the indexed mode and persistence option for watcher refreshes, and remove secondary watches when global
auto_watchis disabled.This uses the existing configuration and tool arguments and retains workspace-root and tool-profile checks. Update the runtime instructions, status hint, README, and configuration reference accordingly. Related: #1429, #1660.
Validation
Rebased onto
3457b21b; preserved the upstream UTF-8 filesystem checks and updatedlist_projectspaging documentation. Only the watcher fix, its tests, and documentation are in this diff.CC=clang CXX=clang++). PassedASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0 scripts/test.sh --suites daemon_application,watcher,sqlite_writer,mcp CC=clang CXX=clang++: 567 passed, 4 skipped, exit 0.9197e801passed the embedded-UI build, process-level watcher/session checks, 476 focused tests (4 skipped), and the complete ASan/UBSan unit suite: 9,905 passed, 9 skipped. These are previous-head results, not a claim that the rebased full suite has completed.tests/test_language_count_contract.shon a clean3457b21bcheckout andscripts/test.sh CC=clang CXX=clang++on the rebased PR: five obsolete surfaces, exit 1. Upstream PR fix(ci): repair language count and Windows CodeQL retrace contracts #2732 fixes that exact issue and is still open. No check is skipped and no unrelated contract or graph-ui changes are bundled here.Local sanitizer builds retain two pre-existing ObjectScript scanner zero-length
memcpyguards; those changes are outside this PR. ASan/UBSan test runs disable LeakSanitizer because of the local ptrace environment.AI assistance: OpenAI Codex assisted with implementation, regression tests, documentation, and review. The submitting contributor is responsible for this change.
Checklist
git commit -s)make -f Makefile.cbm lint-ci)