Fix(mcp): align Go tool text and list_files batch with Win32

The Go minimal server sent models after tools it does not have: read_file
pointed at download_file and search_file, both absent from its nine-tool
set, and the 2 MiB message named a download path that does not exist. It
now names list_files, terminal_exec and the Windows controller server.

Terminal errors lost the one piece of state the model needs to recover.
A busy terminal now says the holder is the web console (no MCP session to
close), and a cancelled exec carries the session_id to poll or release.

list_files ids[] was advertised in the shared schema but answered -32005.
It now implements the Win32 batch contract: 50 ids, ids past the 50 s
deadline marked skipped rather than failed, results in input order. The
deadline only gates starting a host; one already running finishes on its
own timeout, so its result is never mislabelled as a client abort. Each
entry takes the per-device lock the single-host path gets, so a host busy
with another tool fails that entry with -32003 instead of running beside
it. An empty ids array is a valid empty batch, as on Win32.

The initialize instructions now describe only what this build implements.

Co-Authored-By: deepseek-flash
This commit is contained in:
yuanyuanxianganddeepseek-flash committed 2026-11-13 12:57:12 +01:00
1 parent 61b9031269
commit 31883edc09
6 files changed
+433 -32

No files matched your search

+2 -1
View File
@@ -256,7 +256,8 @@ func TestReadFileSizeGate(t *testing.T) {
if c.err == nil || c.err.Code != CodeInvalidParams {
t.Fatalf("error = %+v, want -32602", c.err)
}
if !strings.Contains(c.err.Message, "download_file") {
if !strings.Contains(c.err.Message, "no download_file") ||
!strings.Contains(c.err.Message, "terminal_exec") {
t.Fatalf("message = %q", c.err.Message)
}
}