summaryrefslogtreecommitdiff
path: root/tests/fake-agy.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fake-agy.lua')
-rw-r--r--tests/fake-agy.lua14
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