This recipe uses machine time: it reruns your whole test suite in a managed sandbox, and the sandbox runs for as long as all those runs take. A managed sandbox also needs your plan’s minimum balance of Orca credit in your wallet. Run it with
RUNS=1 first, to check that the suite installs and runs, before you ask for more runs.How it works
The instructions separate flaky tests from broken ones, ask for the evidence (runs/), and require the agent to check each fix before claiming it. Without those rules an agent tends to “fix” whatever failed once.
The program
Examples on this page assume the settings from the shared setup. Run it from the root of a Git repository. It packs the committed files withgit archive, so uncommitted changes and ignored files stay on your machine.
- Python
- TypeScript
git archive --format=tar.gz HEAD src tests. Every sandbox is the same size, shown on the pricing page; a heavy suite run five times may need a narrower selection of tests.
Set RUNS to choose how many times the suite runs:
flaky-output/flaky_report.md, then try a patch locally with git apply --check flaky-output/patches/<test-name>.diff before applying it.
Make it yours
- Point it at one package. For a large repository, name the test command or folder in the prompt, such as “run
pytest tests/api10 times”. - Pre-install dependencies. Put them under
packagesorsetup_commandsin an environment template, so every run starts ready instead of each agent working out how to install them. Installing packages needs network accessenabled. - Keep secrets out. Tests that need real credentials should be skipped in this run. Do not stage
.envfiles; the agent and every command it runs can read the workspace. - Review patches like any pull request. They were written by a model, from code that may itself contain misleading comments. Check them before you apply them.