From 3fa6279f5b988ffb84b820353e8539256f5ad645 Mon Sep 17 00:00:00 2001 From: Markus Fritsche Date: Tue, 12 May 2026 18:55:01 +0000 Subject: [PATCH] =?UTF-8?q?repl:=20:mcp=20tool=20=E2=80=94=20disambiguate?= =?UTF-8?q?=20"no=20alias"=20vs=20"unknown=20alias"=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- repl.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repl.lua b/repl.lua index 70ad6f3..eaac1e1 100644 --- a/repl.lua +++ b/repl.lua @@ -483,9 +483,13 @@ function M.run(config) renderer.status("usage: :mcp tool "); return end 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 - renderer.status("unknown alias: " .. tostring(alias)) + renderer.status("unknown alias: " .. alias) return end local found