Skip to content

MCP: authored synonym produces duplicate autocomplete suggestions and snippets #69

Closed

Description

@AlexMikhalev

Observed released behaviour

The published Rust MCP 1.21.22-rc.1 returns duplicate suggestions for one authored synonym. This reproduces both through the official Python MCP SDK and through the actual released Kilo 7.8.8 backend. It is distinct from the fixed unknown-role defect #63 and synonym-retrieval defect #62.

Tested macOS ARM64 executable SHA-256: 48da284f633ddd34c70e7f028abadd40c99d67d4dff5e518ed1dc966802ecfd7.

Portable fixture

Create concepts/Risk.md:

# Risk
synonyms:: Concern

Use three separate read-only corpus Markdown documents:

Risk: supplier delays could affect the launch date.
Risk decision: approve a second supplier as the mitigation.
Risk action: review lead times every Friday.

Configure a selected/default role named project in .terraphim/config.json, using relevance_function: "terraphim-graph", kg.knowledge_graph_local.input_type: "markdown", an absolute kg.knowledge_graph_local.path to the concepts directory, and one Ripgrep haystack pointing at the separate corpus directory. Set public/publish false, terraphim_it false and read_only true. For a fully local fixture, replace the merged Default, Engineer and System Operator roles with empty local roles and supply an explicit settings directory with profiles.memory.type = "memory" and a fresh default_data_path.

Start the released binary with --profile server --config-dir /absolute/path/to/project; supply TERRAPHIM_SETTINGS_PATH and TERRAPHIM_DATA_PATH for that isolated fixture. No --agent-data-dir is needed.

Actual MCP calls and outputs

build_autocomplete_index({"role":"project"}) reports 2 terms.

autocomplete_terms({"query":"Con","role":"project","limit":5}) returns:

Found 3 suggestions
concern
concern
risk

autocomplete_with_snippets({"query":"Con","role":"project","limit":5}) returns:

Found 2 suggestions
concern — Risk decision: approve a second supplier as the mitigation.
concern — Risk decision: approve a second supplier as the mitigation.

The repeated Concern entries are byte-identical. Kilo's saved tool records contain the same actual output; this is not a model-generated summary. In the same session, Risk and Concern searches correctly retrieve the same three Risk documents and an explicitly unknown role is refused.

Expected / acceptance

  • Return each identical suggestion identity once; retain legitimately distinct terms such as Risk and Concern.
  • Return one copy of an identical alias/source snippet, without losing a different source's snippet.
  • Deduplicate before applying the requested result limit, so duplicate candidates do not consume it.
  • Add real MCP stdio regressions using this authored synonyms:: fixture, covering index rebuild and role changes as well as the initial query.

This is a suggestion-quality defect. The released synonym-search and unknown-role fixes remain verified. Native Kilo UI discovery and marketplace admission are separate from this backend reproduction.

Activity

  1. AlexMikhalev commented on Oct 15, 2026

    @AlexMikhalev
    ContributorAuthor

    Fixed in PR #70 and published as the new immutable MCP 1.21.22-rc.2 prerelease. Release CI passed all build/publication jobs; all seven public assets were downloaded and matched their checksums and GitHub SHA-256 digests. CLI 1.21.22 and prior MCP assets were not changed.

    The existing fuzzy autocomplete already contains prefix matches. The MCP wrapper now merges by the existing normalised displayed-term/concept identity before applying the limit. It requests enough fuzzy candidates to fill distinct slots and preserves different authored aliases of one concept.

    Actual downloaded ARM64 binaries were checked on macOS and Linux using Markdown such as:

    # Risk
    synonyms:: Concern

    After building the project index:

    • autocomplete_terms with query Con, role project, limit 5 returns exactly concern, risk (two suggestions).
    • autocomplete_with_snippets with the same arguments returns exactly one Concern suggestion with the actual Risk document snippet.
    • Adding a separate Icon concept (synonyms:: Pictogram) and using query con, limit 2 returns concern, icon; the repeated prefix no longer consumes the second slot.
    • Limits 0/1/2/5, switching/rebuilding disjoint role indexes, Risk/Concern retrieval equality and unknown-role refusals pass. The four new regressions fail against rc.1 and pass against rc.2.

    The macOS downloaded binary passed all 12 role contracts and five agent interoperability contracts against released CLI 1.21.22. The downloaded Linux binary passed the real search/autocomplete fixture in a network-disabled container. A fresh session in the actual released Kilo 7.8.8 backend also returned the two unique terms, one actual snippet, the same three Risk-only sources for both queries and the expected invalid-role error. This was an API-driven backend check; it does not claim native UI replay or marketplace admission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions