agy-cli 0.1.19: every client tool is listed always loaded, so agy no longer hides large ones from the model (#989)

agy loads an MCP tool on demand, outside the model's function list,
unless the server's tools/list marks it with
_meta {"antigravity/alwaysLoad": true} (agy's changelog, 1.3.5; the key is
in the 1.5.5 binary next to SplitEnabledToolsByEagerLazy and
McpServerSpec.force_all_tools_eager). The bridge's agent has tools: [],
so the model had no working way to load them: on klarkxy's 72-tool
catalog, tools from ~691 tokens up (bash, grep, task, ask_user) were
never offered while read, glob and write were. listTools now adds the
key to every tool it hands agy; the stored catalog and its signature
are unchanged.

Ran: wsl-run (magpie-desktop) with HOME=$(mktemp -d): bun test
packages/agy-cli (13 pass), bun scripts/check.mjs (ok), root bun test
(8207 pass, 19 skip, 0 fail) at base 017cd73e; after the rebase onto
02fe223d, packages/agy-cli + packages/astudio (95 pass) and check again.

Broken by hand: listTools returning this.tools as before makes the new
smoke check red ("1 FAILURES (334 checks)", _meta null on all three).

Not tried: a real agy turn on Gemini 4 Carbon (no Google contact from
here), so that agy now puts the large tools in gen_metadata is from its
changelog and strings, not a run. The report gives sizes, not schemas;
the fixture is sized to them (bash ~7KB, read ~140B).

Reported-by: klarkxy
This commit is contained in:
yetone
2026-11-11 19:20:59 +08:00
parent 02fe223d4d
commit 5341ac1e70
5 changed files with 43 additions and 2 deletions
+31
View File
@@ -888,6 +888,37 @@ let nativeConv
check("tools/list preserves JSON schema", listed?.tools?.[0] === "echo" || logs().some(event => event.type === "toolsList" && event.tools.includes("echo")))
}
{
// #989: agy left tools with larger schemas (the reporter's bash at ~1005
// tokens, grep at ~691) out of the model's function list and loaded them on
// demand, while small ones (read at ~561 and below) were listed. The report
// gives sizes, not the schemas, so these are sized to match.
const words = n => Array.from({ length: n }, (_, i) => `word${i}`).join(" ")
const bigTool = {
name: "bash",
description: words(600),
input_schema: {
type: "object",
properties: {
command: { type: "string", description: words(200) },
timeout: { type: "number", description: words(40) },
workdir: { type: "string", description: words(40) },
description: { type: "string", description: words(60) },
},
required: ["command", "description"],
},
}
const smallTool = { name: "read", description: "Read a file", input_schema: { type: "object", properties: { filePath: { type: "string" } }, required: ["filePath"] } }
const res = await callFetch({ model, messages: [{ role: "user", content: "large tool schema listed" }], tools: [bigTool, smallTool, echoTool] })
await readSSE(res)
const listed = inits().at(-1)?.tools || []
check("every client tool is listed always loaded, a large schema too (#989)",
res.status === 200 && listed.length === 3 &&
listed.every(tool => tool._meta?.["antigravity/alwaysLoad"] === true) &&
listed.find(tool => tool.name === "bash")?.inputSchema?.properties?.command?.type === "string",
JSON.stringify(listed.map(tool => [tool.name, tool._meta, JSON.stringify(tool).length])))
}
{
const secondBody = continuation(nativeBody, nativeEvents, "native-result")
const assistant = secondBody.messages[1]