mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-04 10:48:20 +00:00
fix: watch explicit MCP index targets
Signed-off-by: wargloom <wargloom@gmail.com>
This commit is contained in:
1 parent
3457b21b0a
commit
0325d6a3fa
5 files changed
+860
-155
No files matched your search
@@ -87,9 +87,9 @@ Current keys:
|
||||
|---|---|---|
|
||||
| `auto_index` | `false` | Automatically index new projects when an MCP session starts. |
|
||||
| `auto_index_limit` | `50000` | Maximum file count allowed for automatic indexing of a new project. |
|
||||
| `auto_watch` | `true` | Register the session's project with the background git watcher on connect. Set `false` to keep a session from registering its project (the watcher still runs for other projects). |
|
||||
| `auto_watch` | `true` | Global switch for MCP session watch registration. On the next refresh or registration request, `true` allows session roots and successful `index_repository` targets to be watched; `false` removes all watches. The background watcher can still run with no registered projects. |
|
||||
| `doc_candidates` | `auto` | Score documentation sections against code to store doc↔code candidates (the possible targets of a section, and the sections that may describe a function or file, each with a judged probability). Unset (`auto`), the index mode decides: on for `full` indexes (the default mode), off for `moderate` and `fast`. Set `true` or `false` to choose for every mode; `config reset doc_candidates` returns to `auto`. The scoring grows with sections × functions: under a second up to ~100k functions, ~15 s at ~400k, ~3 minutes on the Linux kernel. Off stores no candidates and leaves the rest of the graph unchanged; on in `fast` mode stores candidates without adding `fast`'s skipped `SIMILAR_TO` / `SEMANTICALLY_RELATED` edges. `index_repository` also takes `doc_candidates` for a single index, which wins over this setting. Applies from the next index. |
|
||||
| `watcher_enabled` | `true` | Master switch for the background watcher subsystem. Set `false` to stop the watcher from starting at all — no poll thread and no project registration. Reindex manually with `index_repository` when disabled. Only an open MCP session's own project is ever watched; `index_status` reports the current state in its `watch` object. |
|
||||
| `watcher_enabled` | `true` | Master switch for the background watcher subsystem. Set `false` to stop the watcher from starting at all — no poll thread and no project registration. Reindex manually with `index_repository` when disabled. Active MCP sessions can register their root project and successful explicit index targets; `index_status` reports the current state in its `watch` object. |
|
||||
| `watch_non_git` | `false` | Also poll project roots that are **not git repositories**. By default the watcher only follows git projects, so a project indexed from a plain directory is never refreshed after its first index — reindex it manually with `index_repository`. Set `true` to poll such roots on the same adaptive cadence with a file-tree scan: the indexer's own discovery walk (same skip lists, `.gitignore` and `.cbmignore` rules) hashed over each file's path, size and mtime. Any change reindexes once; paths the indexer skips (including cbm's own `.codebase-memory/` output) never trigger. The first poll after the daemon starts reindexes each such project once, since nothing records which tree state the index holds. The scan walks the whole tree every poll, so it costs more than git polling on very large trees. Read once when the daemon starts, like `watcher_enabled`. |
|
||||
| `index_max_files` | `off` | Optional maximum number of accepted source files in one discovery run. |
|
||||
| `index_max_source_mb` | `off` | Optional maximum accepted source size in MiB in one discovery run. |
|
||||
@@ -102,15 +102,17 @@ has not run yet).
|
||||
|
||||
> **`watcher_enabled` vs `auto_watch`.** `watcher_enabled` controls whether the
|
||||
> watcher *subsystem* starts at all (the background poll thread). `auto_watch` is
|
||||
> narrower: it only controls whether a connecting session registers *its own*
|
||||
> project with an already-running watcher. When `watcher_enabled=false`,
|
||||
> narrower: it globally controls MCP session watch registration. On the next
|
||||
> refresh or registration request, `false` removes all watches; `true` allows
|
||||
> session roots and successful explicit `index_repository` targets to register.
|
||||
> When `watcher_enabled=false`,
|
||||
> `auto_watch` has no effect — there is no watcher to register with.
|
||||
>
|
||||
> They also differ in **when they are read**, which matters because the watcher
|
||||
> lives in the background daemon, not in your MCP client:
|
||||
>
|
||||
> - `auto_watch` is consulted each time a session would register its project, so
|
||||
> a change applies to sessions that connect afterwards.
|
||||
> - `auto_watch` takes effect on the next refresh or registration request and
|
||||
> applies globally to session roots and successful `index_repository` targets.
|
||||
> - `watcher_enabled` is read **once, when the daemon starts**, because it decides
|
||||
> whether the watcher is built at all. The daemon is long-lived and outlives
|
||||
> individual MCP sessions, so **reconnecting your client is not enough** — retire
|
||||
|
||||
Reference in new issue
Block a user