Skip to content

fix: watch explicit MCP index targets - #2737

Draft
WarGloom wants to merge 1 commit into
DeusData:mainfrom
WarGloom:fix/session-index-watch-registration
Draft

WarGloom wants to merge 1 commit into
DeusData:mainfrom
WarGloom:fix/session-index-watch-registration

Conversation

@WarGloom

@WarGloom WarGloom commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #2733. With auto_watch=true, a successful index_repository request 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 reported watched: false with reason: not_session_project after 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_watch is 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

  • Passed scripts/lint.sh --ci with Cppcheck 2.20.0, make -f Makefile.cbm lint-tidy-diff, scripts/security-audit.sh, and git diff --check.
  • Passed the embedded-UI production build, tests/test_watcher_disabled.sh, and tests/test_worker_session_scope.sh against the resulting binary.
  • Passed scripts/test.sh --suites daemon_application,sqlite_writer,mcp CC=clang CXX=clang++: 476 passed, 4 skipped. Passed ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0 make -f Makefile.cbm test CC=clang CXX=clang++: 9,905 passed, 9 skipped, exit 0.
  • scripts/test.sh stops at Step 0w: the published language-count check lists five surfaces with no remaining count claim (docs/index.html, docs/llms.txt, pkg/npm/README.md, scripts/package-release.sh, server.json). These files and the checker are unchanged from the base commit 4cf44147. This remains a draft while the full entry point is failing.

Local sanitizer builds retain two pre-existing ObjectScript scanner zero-length memcpy guards; 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

  • Every commit is signed off (git commit -s)
  • Tests pass locally (make -f Makefile.cbm test)
  • Lint passes (make -f Makefile.cbm lint-ci)
  • New behavior is covered by tests (the original failure was also observed through MCP)

Signed-off-by: wargloom <wargloom@gmail.com>
@github-actions

Copy link
Copy Markdown

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. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

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.

This branch has not been deployed

No deployments
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.

auto_watch misses successful index_repository targets from another session root

1 participant