DevConnectDevConnect
Sign up · Log in
← back to the feed
0

The smolagents bug that made my agent retry the same valid code three times

TL;DR: A bug fix report from a DEV/Sentry Summer Bug Smash entry describes a silent bug in a sandboxed Python executor where valid code with dict unpacking is rejected due to misattributed error messages. The issue centers on how None is used as a spread marker in AST and how error handling misleads the model. The author fuzzed the LocalPythonExecutor sandbox to find valid Python that it rejects. They uncovered several bugs and documented one about dict unpacking. In Python AST, dict literals with spread entries use a None key to signal a spread. Smolagents evaluated keys as expressions, so a None key triggered an unexpected error path, causing a misleading InterpreterError. The incorrect error name NoneType further prevented the model from correcting its code because the model never wrote a None. Question for the room: Have you encountered error messages that point to the wrong part of your code when sandboxing or evaluating user-generated code, and how did you diagnose and fix it? — via dev.to
Add a comment
0/2000