summaryrefslogtreecommitdiff
path: root/subagents/progress.lua
diff options
context:
space:
mode:
Diffstat (limited to 'subagents/progress.lua')
-rw-r--r--subagents/progress.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/subagents/progress.lua b/subagents/progress.lua
index 274e2a8..087a3c3 100644
--- a/subagents/progress.lua
+++ b/subagents/progress.lua
@@ -193,12 +193,10 @@ end
-- `tool_call_complete` for one of our tools: claim that entry's component so
-- the cards the handler is about to raise have somewhere to render.
function M.claim(event)
- -- The event is host userdata; a host that predates any of these fields
- -- answers nil, and one that predates the whole object cannot be indexed.
- local ok, name = pcall(function()
- return event.tool_name
- end)
- if not ok or type(name) ~= "string" or name:sub(1, #TOOL_PREFIX) ~= TOOL_PREFIX then
+ -- The event is host userdata; an unknown field answers nil rather than
+ -- raising, and activation already refused a host too old to have these.
+ local name = event.tool_name
+ if type(name) ~= "string" or name:sub(1, #TOOL_PREFIX) ~= TOOL_PREFIX then
return
end
if type(event.set_component) ~= "function" then