Skip to content

feat(control): suggest nearest methods on an unknown control call - #339

Open
jeffcrouse wants to merge 1 commit into
mainfrom
fix-unknown-method-hint
Open

feat(control): suggest nearest methods on an unknown control call#339
jeffcrouse wants to merge 1 commit into
mainfrom
fix-unknown-method-hint

Conversation

@jeffcrouse

Copy link
Copy Markdown
Member

Summary

An unknown control method returned a flat unknown method: <x> with no hint — so POST /connect (a plausible guess for the visual-edge method, which is actually connect_nodes) was a dead end. Silent-ish for an LLM/human driver: you can't tell a typo from a missing feature.

Fix

Dispatch now appends — did you mean: a, b, c?, ranking handler keys by prefix match → substring → Levenshtein distance (dropping far matches), ties broken by shorter name so the closest candidate leads.

Verification

/connectconnect_nodes, connect_mapping, connect_control_to_param; /get_mapget_mappings, …; a nonsense method still gets no suggestions. General (helps every future typo). No new method → MCP parity unaffected. Full ctest 99/99.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT

An unknown control method returned a flat "unknown method: <x>" with no hint —
so `POST /connect` (a plausible guess for the visual-edge method, which is
actually `connect_nodes`) was a dead end. Silent-ish for an LLM/human driver:
you can't tell a typo from a missing feature.

Dispatch now appends "did you mean: a, b, c?" — ranking handler keys by prefix
match, then substring, then Levenshtein distance (dropping far matches), with
ties broken by shorter name so the closest candidate leads. `/connect` ->
connect_nodes, connect_mapping, connect_control_to_param; `/get_map` ->
get_mappings, ...; a nonsense method still gets no suggestions.

General (helps every future typo). No new method / behavior change beyond error
text -> MCP parity unaffected. Full ctest 99/99.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QB6eSNJE55ru3g4vsL77GT
@jeffcrouse
jeffcrouse enabled auto-merge (squash) August 11, 2026 14:00
@github-actions

Copy link
Copy Markdown
Contributor

Production gate (core): ✅ PASS

  • 82/82 tests passed (0 failed) in 27.154s

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant