fix(mcp): honor workspace filters and shared engine resource controls - #24
Open
Christopher-Schulze wants to merge 1 commit into
Open
Christopher-Schulze wants to merge 1 commit into
Christopher-Schulze wants to merge 1 commit into
Conversation
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.
Fixes #23.
Generated source files in an ignored directory currently enter the graph through MCP file events, even when initial indexing excludes them. Each batch then repeats full-graph path queries for individual files. This change gives workspace indexing and the MCP watcher the same filters and makes the existing shared-engine mode preserve the resource settings needed for parallel agent sessions.
Changes
.gitignorematchers between directory indexing and watcher filtering. Preserve.codegraphignore, CLI excludes and built-in exclusions; apply size/depth limits and enforce the file limit for new watcher entries. Reload ignore rules on changes without reacting to read-access notifications.OnceCell, and hold a per-socket file lock through startup and the engine lifetime.The
ignorecrate supplies Git ignore matching;fs2was already a workspace dependency. No release/version or default transport changes are included.Validation
macOS arm64, Rust 1.98.0, isolated homes/workspaces/build output, two build jobs:
cargo test --locked -p codegraph-server -- --test-threads=1: 412 passed, 0 failed. One existing model-dependent test remains ignored by upstream; no tests were disabled or weakened.bun mcp-package/test/wrapper-args.test.js: 14 checks passed. The same updated test file against the unchanged upstream wrapper fails the four explicit-workspace cases..gitignore,.codegraphignoreand--excludeproduces searchable unwanted symbols before the patch, and none afterward. The original invokesMemoryManager::initializeunder--graph-only; the patched binary does not. Both runs use the local static backend with an absent model path to avoid model downloads.cargo clippy --locked -p codegraph-server --all-targets --no-depscompletes with existing warnings.-D warningsalso fails on unchanged upstream64f4f30(unused/dead code and existing Clippy findings); the patch adds no diagnostic at a changed/new source location. A globalRUSTFLAGS=-Dwarningsbuild likewise stops at the pre-existingBODY_PREFIX_MAX_CHARSimport incodegraph-c/src/visitor.rs.git diff --checkpass. Full-workspacecargo fmt --all -- --checkalready reports unrelated upstream formatting differences; those files are untouched.Behavior boundaries
Engine options remain process-wide: the first starter configures a socket; later clients do not reconfigure it. The README documents consistent settings, explicitly managed engines, separate sockets and restarting after configuration changes. Existing indexed entries require a forced reindex after ignore-rule changes. Global Git ignores and
.git/info/excludeare outside this change. Direct manual file indexing remains available.The saved production sample identifies the watcher/query hot path, but does not prove an infinite loop or database corruption. This PR makes no throughput or memory-reduction claim based on the synthetic reproduction.