Integration testing agent code-execution tools against real sandboxes
A common practice is to test an agent's run_code tool with mocks, which only confirms that a function gets called and not how real execution behaves. Mocks miss production bugs such as missing runtimes, incorrect output truncation, misreported timeouts, and unintended network access. The article recommends a small integration suite that runs against real sandboxes, focused on the contract between the tool and the model. It shows a Vitest setup using the Sandscale TypeScript SDK, with one sandbox per test file that is created in beforeAll, labeled for cleanup, and given a timeout backstop. The suite covers the happy path, failure reporting, output handling, environment availability, and network isolation.
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