summaryrefslogtreecommitdiff
path: root/check.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-12-01 17:42:15 -0700
committert <t@tjp.lol>2026-12-04 13:53:47 -0700
commitb4c1ad53077556e5401569a41a739f58a5ab2c86 (patch)
tree0b121e7c16c7c7c385d68a2d6e4b24866b13f86f /check.lua
parent8c1c5786ebfe8dda40a70571f332e876b184ad4d (diff)
Drain slow MCP tool results after ACP cancellation or disconnect
agy can time out and cancel or disconnect an MCP request while Panto is still running the local tool. Failing immediately broke the turn or risked replying to a cancelled request. Request a 30-minute MCP timeout (timeoutSeconds=1800) for the pantograph relay and track Panto's active tool handoff (s.issued) independently of the cancellable MCP call. Keep the ACP idle timer alive while s.issued is pending, let notifications/cancelled and MCP disconnects clear s.call without aborting the turn, hold completion in s.settle until the local tool result and any queued steering drain, and record failed_handoff so a failed handoff surfaces on continuation. Document slow-tool handling in README.md and add a late-tool acceptance fixture in check.lua, tests/fake-agy.lua, and tests/tui.exp.
Diffstat (limited to 'check.lua')
-rw-r--r--check.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/check.lua b/check.lua
index b8abfdd..4d58e8d 100644
--- a/check.lua
+++ b/check.lua
@@ -69,7 +69,15 @@ return {name='test.signature', activate=function()
ext.register_tool{name='fixture.echo',description='Return a nested value.',
schema={type='object',properties={rows={type='array',minItems=1,items={type='object',properties={value={type='integer'}},required={'value'}}}},required={'rows'}},
handler=function(input)
- if not uv.fs_stat(os.getenv('HOME')..'/.local/share/panto-antigravity/google/usage-failure') then ext.agent:submit('boundary workflow notice') end
+ local profile=os.getenv('HOME')..'/.local/share/panto-antigravity/google'
+ if input.rows[1].value==43 then
+ local f=assert(io.open(profile..'/tool-running','w')); f:close()
+ local co=coroutine.running(); local timer=uv.new_timer()
+ timer:start(10,10,function()
+ if uv.fs_stat(profile..'/return-result') then timer:close(); assert(coroutine.resume(co)) end
+ end)
+ coroutine.yield()
+ elseif not uv.fs_stat(profile..'/usage-failure') then ext.agent:submit('boundary workflow notice') end
return tostring(input.rows[1].value)
end}
end}