On Python 3.13, a long-running Agno process held on to Agent, session and run state for as long as it lived. The leak came from Agno's cached tool wrappers.
Pydantic's validate_call stores the caller's local variables on each wrapper it builds, and Agno caches those tool wrappers for the life of the process. On Python 3.13, every cached tool kept alive its building frame, which held the Agent, session and run state from the stack.
Agno now clears the frame reference once the validators are built.

Learn more about Python functions as tools in the documentation.
Frequently asked questions
Each wrapper that Pydantic's validate_call builds stores the caller's local variables, and Agno keeps those tool wrappers cached for as long as the process runs. On Python 3.13, each cached tool kept its building frame alive, along with the Agent, session and run state. Agno now drops that reference after it builds the validators.
Yes. Agno cuts the link from the cached validate_call wrapper to the frame that built it, so the frame and the Agent, session and run state are released after the run.

