diff options
| author | t <t@tjp.lol> | 2026-12-05 10:01:32 -0700 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-12-05 10:02:00 -0700 |
| commit | 0b5892bc31fb576099421ecddfbdc7a7b243d02d (patch) | |
| tree | 89193b0bb377e02d449fa591a2f72d58763689b8 /tests/fake-agy.lua | |
| parent | 48b14add01cb106217832e036e3569e494f1d65c (diff) | |
Allow Antigravity requests from any Panto context
Diffstat (limited to 'tests/fake-agy.lua')
| -rw-r--r-- | tests/fake-agy.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/fake-agy.lua b/tests/fake-agy.lua index 1774dec..e5e8e1f 100644 --- a/tests/fake-agy.lua +++ b/tests/fake-agy.lua @@ -1,6 +1,10 @@ -- Offline agy fixture. check.lua installs this with Panto's embedded Lua shebang. local uv, json = require('luv'), require('panto').ext.json local profile = assert(os.getenv('HOME')) .. '/.local/share/panto-antigravity/google' +local function fixture_mode() + local f=io.open(os.getenv('HOME')..'/fixture-mode','r'); if not f then return end + local mode=f:read('a'); f:close(); return mode +end if arg[1] == '--version' then error('unexpected version check') end if arg[1] ~= 'acp' then assert(json.encode({table.unpack(arg)}) == json.encode({ @@ -149,10 +153,16 @@ if not resumed then reply(q,{sessionId='test-session',configOptions=split('gemini-other','high',{'high','xhigh'})}) q=request('session/set_config_option'); assert(q.params.configId=='model' and q.params.value=='gemini-test') reply(q,{configOptions=split('gemini-test','high',{'low','high'})}) - set_level('low') + if fixture_mode()~='diagnostic' then set_level('low') end end -if not servers[1] then finish(prompt('no-tools'),'no-tools-ok') +if fixture_mode()=='diagnostic' then + -- Unsupported xhigh fails after model selection, before a prompt is sent. + assert(not io.read('l'), 'diagnostic unexpectedly sent an ACP request') +elseif fixture_mode() then + local text=fixture_mode() + finish(prompt(text),'headless-'..text..'-ok') +elseif 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) -- Oversized history: the older part rides the system prompt append; the |
