diff options
| author | t <t@tjp.lol> | 2026-12-05 11:13:09 -0700 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-12-05 11:13:44 -0700 |
| commit | 760cb2a9045e0c1cde276a6378841217e655fde3 (patch) | |
| tree | 7afc2e9874ad47122ed09850cb0ce108dc79faae /tests/fake-agy.lua | |
| parent | 0b5892bc31fb576099421ecddfbdc7a7b243d02d (diff) | |
Broaden platform support to Unix beyond macOS
Replace macOS-only underpinnings with portable Unix equivalents so the
provider runs on macOS, Linux, and FreeBSD:
- Replace /usr/bin/nc -U with an embedded panto lua + luv stdio-to-socket
relay everywhere.
- Conditionalize /usr/bin/codesign to macOS; validate binary ownership and
permissions on other Unix platforms.
- Forward D-Bus/XDG keyring session variables on non-macOS while keeping API
keys stripped.
- Use uv.os_tmpdir() (with /tmp fallback for Unix socket sun_path limits)
instead of hardcoded /tmp and /private/tmp.
- Drop --sandbox from agy invocations to match Panto's permissions model
and avoid container/Linuxulator sandbox breakage.
- Update check.lua for non-macOS runners (unshare / direct) and broaden
supported_platforms to unix.
Diffstat (limited to 'tests/fake-agy.lua')
| -rw-r--r-- | tests/fake-agy.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/fake-agy.lua b/tests/fake-agy.lua index e5e8e1f..339faad 100644 --- a/tests/fake-agy.lua +++ b/tests/fake-agy.lua @@ -8,7 +8,7 @@ end if arg[1] == '--version' then error('unexpected version check') end if arg[1] ~= 'acp' then assert(json.encode({table.unpack(arg)}) == json.encode({ - '--gemini_dir', profile, '--sandbox', '-p', '/usage', + '--gemini_dir', profile, '-p', '/usage', }), 'unrecognized fake CLI invocation') if uv.fs_stat(profile .. '/usage-failure') then os.exit(3) end assert(uv.cwd() == profile and uv.guess_handle(0) ~= 'tty') @@ -117,12 +117,12 @@ q = read() local setup, resumed = q.params, q.method == 'session/resume' assert(setup._meta.disableBuiltInTools == true) assert(arg[2]=='--agent' and arg[3]:match('^panto%-%x[%x-]+$') and arg[4]=='--include-default-customizations=false') -assert(arg[9]=='--dangerously-skip-permissions') -assert(arg[5]=='--gemini-dir' and arg[6]==profile) +assert(arg[5]=='--gemini-dir' and arg[6]==profile and arg[7]=='--disable-telemetry' and arg[8]=='--dangerously-skip-permissions' and #arg==8) local af=assert(io.open(profile..'/config/agents/'..arg[3]..'.md')); local agent=af:read('a'); af:close() for _,line in ipairs({'name: '..arg[3],'mainAgent: true','subagent: false','excludeDefaultComponents: true','inheritCustomizations: false','inheritMcp: false','tools: []'}) do assert(agent:find('\n'..line..'\n',1,true),line) end local servers=json.decode(assert(agent:match('\nmcpServers: ([^\n]+)'))) -if uv.fs_stat(profile..'/no-tools') then assert(#servers==0) else assert(#servers==1 and servers[1].name=='pantograph' and servers[1].command=='/usr/bin/nc') end +local panto=assert(uv.fs_realpath(uv.exepath())) +if uv.fs_stat(profile..'/no-tools') then assert(#servers==0) else assert(#servers==1 and servers[1].name=='pantograph' and servers[1].command==panto and servers[1].args[1]=='lua' and servers[1].args[2]=='-e') end assert(#setup.mcpServers==#servers) local server=setup.mcpServers[1] if server then |
