From f1f1c5bc66ea1d6019f84050aa21e4476330a719 Mon Sep 17 00:00:00 2001 From: t Date: Thu, 3 Dec 2026 08:44:58 -0700 Subject: Preserve ACP sessions across Esc and resume unconditionally Killing agy on Esc and defaulting save_session off forced cold ACP restarts that re-billed the flattened conversation transcript as uncached input. Storing session checkpoints in Panto's global state.toml also leaked unbounded per-session keys into UI preferences. Send ACP session/cancel on Esc with a non-extendable 3s SIGKILL fallback and reconcile post-cancel prefix hashes so follow-up prompts and /proceed keep the warm session. Remove save_session and panto.ext.state usage, tracking each ACP session's valid resume tip atomically under the isolated Google profile instead. Breaking: [providers.].save_session is rejected; native session resume is now always enabled. --- check.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'check.lua') diff --git a/check.lua b/check.lua index 8c6a915..36b8e2f 100644 --- a/check.lua +++ b/check.lua @@ -30,6 +30,8 @@ local function check() {name='fixture.echo',description='Echo',input_schema_json='{"type":"object"}'}}} local _,none=catalog(req,{}); assert(#none==0) local by,one=catalog(req,{'std.read'}); assert(#one==1 and by.std__read and not by.fixture__echo) + local configure=dofile(root..'/extensions/antigravity-acp.lua').configure + assert(not pcall(configure,{providers={antigravity={protocol='antigravity-acp',save_session=true}}})) local cfg, data = home .. '/.panto', home .. '/.local/share/panto' assert(run('/bin/mkdir', {'-p', cfg .. '/extensions', data}) == 0) assert(run('/bin/cp', {'-cR', assert(os.getenv('HOME')) .. '/.local/share/panto/rocks', data .. '/rocks'}) == 0) @@ -42,7 +44,6 @@ local function check() [providers.antigravity] protocol="antigravity-acp" -save_session=true ]]) write(cfg .. '/models.toml', '[antigravity.fast]\nmodel="gemini-test"\ninput=10.0\noutput=10.0\ncache_read=1.0\ncache_write=10.0\n') write(cfg .. '/SYSTEM.md', 'Short answers.') @@ -105,6 +106,7 @@ end} if tui~=0 then error('TUI check failed: '..read(home..'/screen'):gsub('\27%[[0-9;?]*[A-Za-z]', ''):sub(-3500)) end assert(uv.fs_stat(home..'/thinking-rendered'),'ACP thought did not reach the native thinking component') local agents = assert(uv.fs_scandir(google .. '/config/agents')); assert(not uv.fs_scandir_next(agents), 'Generated agent left in private profile') + assert(not uv.fs_stat(data .. '/state.toml') or not read(data .. '/state.toml'):find('antigravity', 1, true), 'state.toml polluted with session checkpoint') local screen = read(home .. '/screen'):gsub('\27%[[0-9;?]*[A-Za-z]', '') assert(screen:find('1.3k/1M ctx',1,true),'expected ACP context occupancy, not summed turn inputs') assert(screen:find('3.4k tok',1,true),'expected primary and steering usage counted exactly once') -- cgit v1.3