Repository navigation
fix: deduplicate MCP autocomplete before limits - #70
Merged
Merged
Conversation
This was referenced Oct 15, 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.
Both role-bound autocomplete tools appended prefix matches that the existing fuzzy search already returns. A
Concernsynonym could therefore appear twice, consuming the requested result limit and repeating the same snippet.Merge prefix and fuzzy results by the existing normalised displayed-term/concept identity before applying the limit. Prefix ordering is preserved, distinct aliases such as
RiskandConcernremain available, and another fuzzy concept can fill the next slot. The graph expansion uses the same identity. No dependency, CLI behaviour or existing release is changed.Validation: four new real-stdio regressions fail against released MCP
1.21.22-rc.1and pass against the correction. All 12 role contracts and five agent interoperability contracts pass, using actual temporary Markdown graphs, actual search results and the released agent CLI. Tests cover limits 0/1/2/5, role switches/rebuilds, distinct same-concept aliases and a real second fuzzy concept/snippet. Formatting, workspace Clippy with denied warnings and all-targets compilation pass. Existing Cargo manifest/unused-patch notices remain unchanged.Refs #69. The issue remains open until the next immutable MCP prerelease is downloaded and checked.