Repository navigation
perf(mcp): accelerate explicit single-file code_grep - #1712
Merged
Merged
Conversation
This was referenced Oct 28, 2026
…-local-grep # Conflicts: # CHANGELOG.md
alex09x
marked this pull request as ready for review
October 28, 2026 08:36
Owner
Author
…-local-grep # Conflicts: # CHANGELOG.md # crates/prod-code-mcp/tests/tools.rs
Owner
Author
…-local-grep # Conflicts: # CHANGELOG.md
Owner
Author
This was referenced Oct 28, 2026
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.
Problem
Explicit single-file
code_grepsearches went to remote ripgrep first. On a delayed remote exec, even an empty result waited for the remote command before the local fallback could run (#1531). Directory searches are a separate path and remain remote-first (#1321).Change
..traversal and symlinks resolving outside the checkout.spawn_blockingfirst for contained single files.Reproduce and verify
The public single-file
code_grepregression searches for a missing token and an existing token while a mock remote gateway delaysExecRequestby 2 seconds. The searches return locally and confirm no remote exec was started. A second public test verifies that both../traversal and an absolute file outside the checkout are refused before searching.Before the change, the empty search waited for the remote command and failed at 2.01 s. The original single-file test measured 0.06 s after the optimization.
Measurements
For the controlled empty-result fixture, latency changed from 2.01 s (remote-first mock baseline) to 0.06 s (local file search). This is a test fixture measurement, not a repository-wide benchmark.
Checks
Revision
ff551d5930e970fde035100ae279ec936df23755, Linux build node:cargo fmt --all -- --check: exit 0.cargo clippy -p prod-code-mcp --all-targets: exit 0 with existing warnings (124 warnings in the test build and one unrelated test-helper warning); no strict-clean claim.cargo test -p prod-code-mcp --test tools code_grep_ -- --nocapture: 2 passed, 0 failed.prod-code impact --base origin/main --depth 1 --json: exit 0; selected the directly affected grep tests and reported incomplete callers at depth 1 plus a test-helper reference timeout.Current head
923e1949f1653c57abcbe5802ae125facea1c27fintegrates main after #1711. The merge adds only the #1711 signature changes and changelog entry relative toff551d59; grep implementation and regression tests are unchanged.Closes #1531
Refs #1321