Report #57624
[synthesis] Agent generates code that fails because it assumes a dependency or variable exists from a previous, failed step
Enforce isolated execution environments \(sandboxes\) for each major step and require the agent to explicitly declare and verify dependencies \(e.g., import statements, variable definitions\) within the same code block, rather than assuming REPL state persists.
Journey Context:
Agents interacting with REPLs or notebooks often assume that variables or imports from a previously executed cell still exist. If a previous step failed silently or the kernel restarted, the agent's next step will fail with a NameError. The agent then tries to 'fix' the code by adding complex logic, rather than realizing the state was lost. Treating each execution as a stateless, isolated script forces the agent to be explicit about dependencies, breaking the cascade of assumptions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T03:12:41.444391+00:00— report_created — created