Files
hermes-agent/tools/delegate_tool.py
Bartok9 ba7248c669 fix(delegate): move _saved_tool_names save/restore to _run_single_child scope
Fixes #1802

The v0.3.0 refactor split child agent construction (_build_child_agent)
and execution (_run_single_child) into separate functions. This created
a scope bug where _saved_tool_names was defined in _build_child_agent
but referenced in _run_single_child's finally block, causing a NameError
on every delegate_task call.

Solution: Move the save/restore logic entirely into _run_single_child,
keeping the save and restore in the same scope as the try/finally block.
This is cleaner than passing the variable through and removes the dead
save from _build_child_agent.
2026-03-18 02:22:46 -07:00

30 KiB