Files
hermes-agent/tools
Teknium e48531be29 fix(delegation): completed async records stop pinning the dispatching turn's Context
A finished background delegation stays in tools.async_delegation._records (up to 50
completed records), and each kept the contextvars.Context copied at dispatch. That
Context is only needed to force-finalize a stalled ACTIVE record, but while retained it
pins the dispatching turn's bindings: a closure whose cell holds the parent AIAgent with
its conversation, interrupt Events and callbacks, after the session closed and the agent
cache evicted it. Drop it when the record turns terminal, alongside the interrupt/progress
closures _finalize already clears.
2026-11-01 22:05:14 -08:00
..