summaryrefslogtreecommitdiff
path: root/check.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-12-03 18:03:21 -0700
committert <t@tjp.lol>2026-12-04 13:53:47 -0700
commit34d347ffb9ced22f6004af320958f9d1a0ae22d2 (patch)
treea1fd83ef45d806b5ad448b2b5927d7a19c4accef /check.lua
parent8c167c49f18c76f1f867778341ac821591d9d990 (diff)
Page oversized MCP tool results to stay under agy's capv0.1.0
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.
Diffstat (limited to 'check.lua')
-rw-r--r--check.lua5
1 files changed, 4 insertions, 1 deletions
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)