Repository navigation
perf(mcp): bound unqualified code_references batch waits - #1713
Merged
Merged
Conversation
…lified-reference-batch # Conflicts: # CHANGELOG.md
…lified-reference-batch # Conflicts: # CHANGELOG.md
alex09x
marked this pull request as ready for review
October 28, 2026 08:50
Owner
Author
|
Independent read-only P0–P3 review of 103b521: APPROVE, no findings. The batch/reference deadlines and partial-result regressions passed on the current base. |
…lified-reference-batch # Conflicts: # CHANGELOG.md
…lified-reference-batch
Owner
Author
|
Independent read-only P0–P3 re-review of 3c369d2: APPROVE, no findings. The current-base merge contains no changes to the batch/reference implementation or tests; all focused checks are recorded in the PR. |
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
Issue #1594 describes Rust
code_referenceslookups for common unqualified names taking up to about 20 seconds in multi-target discovery. A batch of several symbols also needs to preserve time for later entries and return useful partial results when one reference scan exhausts its share.Change
code_referencesbatch symbol a default 2 second share when no path hint or explicit budget is supplied.execute_toolwithout an outer timeout that would abort candidate resolution and discard the structured partial result. The batch stops starting later symbols when its shared budget is exhausted.budget_msfrom the start ofhandle_references, cap it at the existing 8 second maximum, and return an explicit partial-results note when the scan reaches its deadline.Reproduce and verify
Unit regressions verify that an unqualified name receives the 2 second budget, a path-scoped name retains the shared budget, an explicit budget overrides the default cap, and a partial result returned just after the 2 second share survives the batch wrapper. The existing multi-candidate test verifies that
execute_toolreturns candidate/partial guidance when its own shared budget expires. Reference-scan tests verify that shorter budgets are honored, long budgets retain the 8 second cap, and an expired deadline returns partial guidance without issuing an LSP query.Measurements
No performance claim. The batch regression waits 2.1 seconds to prove a returned partial result is not discarded at the former outer 2 second timeout.
Checks
Revision
3c369d284cd72a7b42102d8820469ac49350bcc5, Linux build node:cargo fmt --all -- --check: exit 0.cargo clippy -p prod-code-mcp --all-targets: exit 0 with existing warnings (125 warnings in the test build); this is not a strict-clean lint claim.cargo test -p prod-code-mcp --lib unqualified_reference_batch_ -- --nocapture: 2 passed, 0 failed.cargo test -p prod-code-mcp --lib multi_target_deadline -- --nocapture: 2 passed, 0 failed.cargo test -p prod-code-mcp --lib multi_candidate_shared_budget_returns_partial_result_when_expired -- --nocapture: 1 passed, 0 failed.prod-code impact --base origin/main --depth 1 --json: exit 0; it selected the direct batch/reference tests and reported incomplete caller coverage at depth 1. No broad suite was run.The current head also integrates #1715. Its merge commit adds the definition-body worktree fix, tests and changelog only; batch/reference sources and tests are unchanged from
f2c94f47.Closes #1594