#2858·smolagents

BUG: LocalPythonExecutor 在后续的 __enter__ 失败时会提前退出之前进入的上下文

作者: zjyHeart创建于 2026年9月27日更新于 2026年9月28日

Problem

LocalPythonExecutor leaves an earlier context manager entered if a later __enter__ fails in the same with statement. Standard Python calls the earlier manager's __exit__ with that exception. This can leave a lock held or a resource open after the agent sees an error.

内容来源: huggingface/smolagents