diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/fake-agy.lua | 19 |
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') |
