Checks keep failing on a run

Find out why CI or a check step fails, re-run checks, deal with flaky tests, and fix sandbox setup so agents can build your repo.

On this page

When a check fails, Duun sends the failure back to the agent so it can fix it, up to a set number of attempts. If the run still fails, you’ll get a notification and the run stops with the check that failed.

Symptoms

  • The run’s Checks tab shows red checks, or a count like 15/18.
  • The run went back to an earlier step several times, showing attempt 2, attempt 3.
  • You were notified that a run failed after retries.

Likely causes and fixes

A real failure the agent couldn’t fix

  1. Open the run and go to the Checks tab.
  2. Open the failing check to read its log.
  3. If the fix is clear, tell the agent in the conversation, or use Take over in terminal to fix it yourself.
  4. Click Re-run checks.

The check ran out of attempts

A check step’s gate decides what happens on failure: which earlier step to return to, how to retry (Retry with feedback, Start fresh or Escalate), and the maximum attempts. If the agent keeps failing for the same reason, raising the attempts rarely helps. Look at the log first. To change the policy, edit the step in the workflow. See Gates and failure handling.

A flaky test

If the same test passes and fails without code changes:

  • Click Re-run checks once to confirm it’s flaky.
  • Hand the run to the tester agent with Hand to another agent…. It’s built to reproduce failures and hunt flakes.
  • Consider a factory for flaky tests from Explore, which reruns, quarantines and opens a fix.

The sandbox can’t build your repo

If the log shows missing tools, packages or services, the sandbox isn’t set up for the repo.

  1. Open the factory and go to the Repos tab.
  2. Open the repo’s menu and check its sandbox settings.
  3. Add what’s missing to Install commands, one command per line.
  4. Choose Refresh snapshot so the next run starts with the new setup.

Monorepos and heavy builds may need the Large sandbox size. See Images and networking.

The check needs a secret or network access

Tests that call a database or external service need its credentials. Add them in Settings → API keys & secrets so agents get them as environment variables. Commands with network access always ask first, unless a command rule allows them. See Permissions and approvals.

The check command itself is wrong

For CI green and QA check gates, Duun runs the command set on the step, for example pnpm ci. If it changed in your repo, update the step in the workflow and apply a new version. Runs in progress keep the version they started on, so restart the run afterwards.

Still stuck? Contact support with the run id and the name of the failing check.

    Type to search the docs, help center and blog.