repl: :mcp tool — disambiguate "no alias" vs "unknown alias" errors
Surfaced by Phase 7 verify test case #29: typing :mcp tool list_dir (no dot) printed "unknown alias: nil" instead of a useful diagnostic. The parse failure was being conflated with the alias-not-found case. Now: :mcp tool list_dir -> tool name missing alias prefix: list_dir :mcp tool unknown_alias.x -> unknown alias: unknown_alias :mcp tool known_alias.bogus -> unknown tool: known_alias.bogus Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -483,9 +483,13 @@ function M.run(config)
|
|||||||
renderer.status("usage: :mcp tool <alias.name>"); return
|
renderer.status("usage: :mcp tool <alias.name>"); return
|
||||||
end
|
end
|
||||||
local alias, tname = name:match("^([^.]+)%.(.+)$")
|
local alias, tname = name:match("^([^.]+)%.(.+)$")
|
||||||
local sess = alias and mcp_sessions[alias]
|
if not alias then
|
||||||
|
renderer.status("tool name missing alias prefix: " .. name)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local sess = mcp_sessions[alias]
|
||||||
if not sess then
|
if not sess then
|
||||||
renderer.status("unknown alias: " .. tostring(alias))
|
renderer.status("unknown alias: " .. alias)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local found
|
local found
|
||||||
|
|||||||
Reference in New Issue
Block a user