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 /acp.lua | |
| parent | 48b14add01cb106217832e036e3569e494f1d65c (diff) | |
Allow Antigravity requests from any Panto context
Diffstat (limited to 'acp.lua')
| -rw-r--r-- | acp.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -144,8 +144,7 @@ local function install_agent(s, profile) local made,err,code=uv.fs_mkdir(dir,448); assert(made or code=='EEXIST',err) local st=assert(uv.fs_lstat(dir)); assert(st.type=='directory' and st.uid==uv.getuid() and st.mode & 18==0,'Unsafe agy agent directory') end - -- Active threads hold an exclusive lock on this Panto session ID. - local name='panto-'..s.sid:lower() + local name='panto-'..s.agent_key local servers=json.array({}) if #s.list>0 then servers[1]=relay(s) end local data=([[--- @@ -379,7 +378,7 @@ function M.launch(s, first, resume_id) elseif s.prompting and not s.cancelling and u.sessionUpdate=='usage_update' and count(u.used) and count(u.size) and u.size>0 and u.used<=u.size then s.context_window={used=u.used,size=u.size} elseif s.prompting and not s.cancelling and (u.sessionUpdate=='tool_call' or u.sessionUpdate=='tool_call_update') then - pcall(s.observe,u) -- a cosmetic mount failure must not cancel an agy turn + if s.observe then pcall(s.observe,u) end -- a cosmetic mount failure must not cancel an agy turn elseif (u.sessionUpdate=='agent_message_chunk' or u.sessionUpdate=='agent_thought_chunk') and u.content.type=='text' and s.prompting and not s.cancelling then s.delta(u.sessionUpdate=='agent_message_chunk' and 'text' or 'thinking',u.content.text) end @@ -392,6 +391,9 @@ function M.launch(s, first, resume_id) child,pid=uv.spawn(bin,{args=args,cwd=s.cwd,env=env,detached=true,stdio={stdin,stdout,nil}},function() close(child); child=nil; if closed then cleanup() else s.fail('Antigravity exited; not replaying') end end); if not child then local err=pid; pid=nil; error(tostring(err)) end; local buf='' + -- A warm upstream must not keep a finished print invocation alive. + -- The request timer and Panto stream pump drive outstanding work. + child:unref(); stdout:unref(); stdin:unref() assert(stdout:read_start(function(e,data) if closed then return end; if e or not data then s.fail('ACP stream closed'); return end buf=buf..data |
