docs(roadmap): add #461 — config suggest_field uses pure edit-distance; { "mcp": { "servers": ... } } (VS Code MCP convention) is told "Did you mean 'env'?"#3074
Open
Yeachan-Heo wants to merge 1 commit into
Conversation
…e; '"mcp": { "servers": ... }' (VS Code MCP convention) suggests 'env' instead of 'mcpServers'
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.
ROADMAP pinpoint #461 —
.claw.jsonvalidator suggestsenvwhen user writes the VS Code-stylemcp.serversnested formDogfooded across two consecutive Clawhip pinpoint nudges (11:30 message 1508069585461706783 triggered the MCP investigation; 12:00 message 1508077133459751073 triggered finishing it). Root cause traced between the two.
The bug in one line
The user wrote the VS Code MCP convention (
{ "mcp": { "servers": { ... } } }— used by VS Code'ssettings.json, byhermes_cli/config.py:478, by many MCP docs). claw rejects it and suggestsenv— a completely unrelated config block. User follows the suggestion → no MCP servers configured → silent functionality loss with actively wrong remediation.Suggestion-quality matrix
mcpServersenvmcp(VS Code nested form)envmcpServer(singular camelCase)mcpServersmcpserver(singular lowercase)mcpServersmcpServrs(typo)mcpServersMCPServers(case variant)mcpServersmcp_servers(snake_case)mcpServersservers(just servers)mcpServersRoot cause (traced)
rust/crates/runtime/src/config_validate.rs:396-407:Pure Levenshtein, threshold-3 filter, no prefix awareness, no semantic awareness. For
mcp(len 3):mcpServers= 7 (insertions ofServers) — filtered out by thresholdenv= 3 (full substitution) — at threshold, winsmcpis a 3-character prefix ofmcpServersand shares 100% of its characters with the intended key. Edit-distance has no way to express that — every extra character in the longer candidate is a +1 insertion penalty.Why distinct from existing items
ConfigLoader::discoverancestor-walk under-discovery (config files invisible from subdirs).MissingCredentialserror-copy improvements (adjacent-provider env-var hints).None address the config-key validator's suggestion-ranking algorithm itself producing actively wrong suggestions for prefix-substring inputs.
Why it matters
settings.jsonuses"mcp": { "servers": { ... } }. Users coming from VS Code naturally write the nested form.external/hermes-agent/hermes_cli/config.py:478) usesmcpnested. Any user copying from hermes config hits this.envis the absolute worst possible suggestion — completely different concept (environment variables), zero overlap with MCP server registration.mcp listreportsconfigured_servers: 0with no signal that MCP was the user's actual intent.Required fix shape
(a) Add prefix-match as higher-priority than edit-distance. Before computing edit-distance, check if
inputis a case-insensitive prefix of any candidate. If yes, return that candidate. Makesmcp→mcpServers(prefix wins) instead ofmcp→env(edit-distance wins).(b) Add nested-key awareness for known scoped patterns. When unknown key is the parent of a known-nested form (
mcp.serverswould be valid under VS Code convention), emit specific diagnostic:"unknown key 'mcp' — claw uses flat camelCase 'mcpServers' instead of VS Code-style 'mcp.servers' nested block. Rewrite as: { \"mcpServers\": { ... } }".(c) Add a
claw doctorcheckmcp_config_form_driftthat detects top-levelmcpblocks and warns to migrate.(d) Update README/
--helpto document the canonicalmcpServerskey and call out that VS Code-stylemcp.serversis not accepted.(e) Regression coverage:
suggest_field("mcp", FIELD_SPECS)assertsSome("mcpServers")notSome("env"). Full matrix as parameterized tests.Acceptance check
Should match (currently outputs
Did you mean "env"?).—
[repo owner's gaebal-gajae (clawdbot) 🦞]