Software factory / Runs
Retry a run
A run failed, and the cause is gone now. For example, the provider was down, or you added credits. Start the agent again, without a new push.
4 min read
You need:
- Write access, or you are the author of the issue or the pull request. See Who can retry what.
1. Find the row of the agent
- Open the issue or the pull request.
- In the Factory panel, find the row of the agent. Read the reason and the next step under it.
2. Do the next step
Do what the next step says, for example save a new key in the Factory settings. To look up a cause, see Why a run failed.
3. Click Retry
Click Retry under the row. The line next to the button says Started a new run of Safe., and the row shows the new run.
If no run starts, the line next to the button says why.

Tip
With write access, the page of a failed run also has Retry. It opens the page of the new run.
Done
The agent runs again on the same item, with no new push.
Who can retry what
- People with write access: a run that failed, a run that a person stopped, and a run that was skipped for a temporary cause. The new run does not count toward the daily runs of the author.
- The author of the item: only a run that failed for a temporary cause. The new run counts toward the daily runs of the author. At the limit, Source refuses the retry and says to ask a maintainer.
Retry from src, MCP or REST
Get the id of the run from src factory runs 12. The columns REASON and NEXT STEP show why the run failed. Then run it again:
src factory rerun <run id>
src factory rerunprints the id of the new run. When no run starts, it prints why on stderr. When the forge refuses you, it prints why and exits 1.--json runId,skippedprints the answer as JSON.src factory runs 12 --json id,status,failureKind,nextStep,canRetrytells you before if you can retry a run (canRetry).- The MCP tool is
rerun_factory_run, withowner,repoandid. - The REST route is
POST /api/v1/repos/{owner}/{repo}/factory/runs/{id}/rerun. The answer is 201 withrunIdwhen a run started, and 200 withskippedand the reason when none started. It is 403 when you cannot retry the run, and 400 when the run cannot run again.
For a reader who is not the author and has no write access, failureKind and nextStep are null, and reason is the general reason. src factory run, get_factory_run and GET .../factory/runs/{id} give such a reader the run only, with no verdicts and no log.
When a run can run again
A new run starts only when all of these are true:
- The run failed, a person stopped it, or it was skipped for a temporary cause. It is the newest run of its step on the issue or the pull request.
- Its step is a built-in step, other than Keep green: CI self-heal, Keep green: Merge queue, Dependencies and CI cache. A custom agent cannot run again this way.
- The agent and the step are on, and no run of the step is waiting or running.
- The issue or the pull request is open, and the rules for its author allow the agent. See Pull requests from people without write access.
On a pull request, these rules hold too:
- The run is on the current head. After a push, the factory starts its own runs on the new head.
- Update branch and the push of an agent start only the audit on the new head. If a person with write access clicks Retry on a run of the old head, that agent starts on the new head. It starts only when no run of that agent is on the new head.
A run that a rule skipped cannot run again this way. To run the agent now, see Start an agent run.