summaryrefslogtreecommitdiff
path: root/tests/fake-agy.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-12-03 16:43:51 -0700
committert <t@tjp.lol>2026-12-04 13:53:47 -0700
commit8c167c49f18c76f1f867778341ac821591d9d990 (patch)
treec86df0cf3af948fcff8979ec7c543b8e137cbfdc /tests/fake-agy.lua
parentf1f1c5bc66ea1d6019f84050aa21e4476330a719 (diff)
Carry oversized history reseeds in the system prompt append
agy keeps only the first ~191 KB of a user message, so a large cold reseed dropped the newest history and the current request. When transcript plus request exceed 160 KB, move the older part of the transcript into the new session's system prompt append, framed as a verbatim record, and keep the newest part with the request in one user message. Refuse a single request too large to fit. Record the probes in docs/findings.md and the separate ~9.9 KB MCP tool result cap in BUGS.md.
Diffstat (limited to 'tests/fake-agy.lua')
-rw-r--r--tests/fake-agy.lua19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/fake-agy.lua b/tests/fake-agy.lua
index b1537ad..904f3bf 100644
--- a/tests/fake-agy.lua
+++ b/tests/fake-agy.lua
@@ -77,6 +77,11 @@ local function load_catalog(server)
assert(echo.isError==false and echo.content[1].text=='42')
local r = rpc(4, 'tools/call', {name='std__read', arguments={path=uv.cwd() .. '/.panto/SYSTEM.md'}}).result
assert(r.isError == false and r.content[1].text:find('Short answers', 1, true))
+ -- Push later transcript reseeds past one agy message (acp.message_bytes).
+ for i=1,4 do
+ local f=rpc(20+i,'tools/call',{name='std__read',arguments={path=uv.cwd()..'/.panto/history-filler.txt'}}).result
+ assert(f.isError==false and #f.content[1].text>40000)
+ end
-- Keep the peer connected for subsequent turns.
end
end
@@ -132,13 +137,21 @@ end
if not servers[1] then finish(prompt('no-tools'),'no-tools-ok')
elseif resumed then local resumed_prompt=prompt('resume'); check_relay(); finish(resumed_prompt, 'resumed-ok') elseif uv.fs_stat(profile..'/usage-failure') then
assert(not resumed)
- q=request('session/prompt'); local blocks=q.params.prompt; assert(#blocks==1)
- local text=blocks[1].text
+ -- Oversized history: the older part rides the system prompt append; the
+ -- newest part and the request stay in one user message under the agy cap.
+ q=request('session/prompt'); assert(#q.params.prompt==1)
+ local user=q.params.prompt[1].text; assert(#user<=160000,'user message over the agy cap')
+ local head=setup._meta.antigravity.systemPrompt.append:match('^Short answers%.\n\nSelected Panto conversation history, earlier part%. [^\n]+\n\n(.*)\n\nEnd of the earlier part of the selected Panto conversation history%.$')
+ local tail,request_text=user:match('^Selected Panto conversation history[^\n]*:\n\n(.*)(\n\nCurrent user request:\n[^\n]+)$')
+ assert(tail and (head~=nil)==(user:find('continued from the record',1,true)~=nil),'record and user message disagree')
+ local text=(head or '')..tail..request_text
assert(text:find('[User]: hello',1,true))
assert(not text:find('same-session-ok',1,true) and not text:find('resumed-ok',1,true),'abandoned branch leaked')
local current=assert(text:match('Current user request:\n([^\n]+)$'))
assert(not text:find('[User]: '..current,1,true),'current prompt duplicated')
- if current~='boundary workflow notice' then assert(text:find('[Assistant]: primary-tool-ok',1,true)) end
+ if current~='boundary workflow notice' then
+ assert(text:find('[Assistant]: primary-tool-ok',1,true)); assert(head and #head>0 and head:sub(-2)=='\n\n' and tail:sub(1,1)=='[','expected the oversized transcript to overflow into the system prompt at an entry boundary')
+ end
if current=='branch-probe' then
finish(q,'branch-seed-ok'); finish(prompt('warm-probe'),'warm-after-seed-ok')
local esc=prompt('esc-probe')