Skip to main content
This agent takes a snapshot of your repository, runs the test suite several times in a managed sandbox, and finds the tests that pass on one run and fail on another. For each one it explains the likely cause and writes a proposed patch. It never pushes anything: you get a report and patch files to review. You will use: a managed sandbox, uploaded files, and artifacts.
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 with git archive, so uncommitted changes and ignored files stay on your machine.
Orca stages at most 16 MiB from one file, so the program stops if the compressed snapshot is bigger. For a large repository, archive only the part you need, for example 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:
Read 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/api 10 times”.
  • Pre-install dependencies. Put them under packages or setup_commands in an environment template, so every run starts ready instead of each agent working out how to install them. Installing packages needs network access enabled.
  • Keep secrets out. Tests that need real credentials should be skipped in this run. Do not stage .env files; 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.