From 34d347ffb9ced22f6004af320958f9d1a0ae22d2 Mon Sep 17 00:00:00 2001 From: t Date: Thu, 3 Dec 2026 18:03:21 -0700 Subject: Page oversized MCP tool results to stay under agy's cap agy truncates any MCP tool result above about 10 KB before the model sees it, and splitting the text into several blocks does not avoid the cap. Results over 10,000 bytes now go out as parts of at most 9,600 bytes; the first part carries a notice and the model fetches the rest through a relay-only result_part tool. Panto still runs the tool once. Removes BUGS.md; the evidence moves to docs/findings.md. --- check.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'check.lua') diff --git a/check.lua b/check.lua index 8a2d200..d0617a5 100644 --- a/check.lua +++ b/check.lua @@ -34,7 +34,10 @@ local function check() local u={inputTokens=155,outputTokens=41,thoughtTokens=8,cachedReadTokens=55,cachedWriteTokens=10,totalTokens=196} local v=usage(u); assert(v.input==90 and v.output==41 and v.cache_read==55 and v.cache_write==10 and v.reasoning==8) u.totalTokens=261; assert(usage(u).input==155); u.totalTokens=99; assert(not usage(u) and not usage({}) and not usage(nil)) - local catalog=dofile(root..'/catalog.lua').catalog + local cat=dofile(root..'/catalog.lua'); local catalog=cat.catalog + local wide='a'..('\u{754C}'):rep(8000); local pages=cat.pages(wide) -- no newline to cut at: characters stay whole + assert(#pages==3 and table.concat(pages)==wide and #cat.pages('abc')==1) + for i,p in ipairs(pages) do assert(utf8.len(p) and #cat.part(pages,7,i)<=cat.result_bytes) end local req={tools={{name='std.read',description='Read',input_schema_json='{"type":"object"}'}, {name='fixture.echo',description='Echo',input_schema_json='{"type":"object"}'}}} local _,none=catalog(req,{}); assert(#none==0) -- cgit v1.3