Developer finds silent bug in Hugging Face's smolagents that misled AI into retry loops
A developer stress-testing Hugging Face's smolagents framework discovered a critical silent bug in its sandboxed Python interpreter, LocalPythonExecutor, that caused AI agents to silently fail without any crash or alert. The bug stemmed from how the sandbox mishandled Python's AST representation of dictionary spread operators, incorrectly blaming a None marker as a user-written value and generating a misleading error message. Because smolagents feeds error messages back to the model as corrective guidance, the agent repeatedly retried identical valid code, burning LLM calls and exhausting its step budget while appearing to function normally. The issue was only detected after the developer integrated Sentry event tracking, which revealed three consecutive identical failures on a single line that would otherwise have looked like poor model performance. Further fuzzing uncovered additional sandbox flaws, including a process-freezing integer exponentiation operation and a broken tuple unpacking error message.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in