Skip to content
DocsStar33Playground

Rerun and fork a run

How-to guideLast updated 2026-12-02 · 53a7a7361Quickstart

Two actions in the run view start a new run from a finished one, so you can ask “what happens if only this changes?”. Both leave the original run untouched. Use Compare runs afterwards to see the difference.

Action Starts from Use it to
Rerun The run’s task and saved launch config, from the beginning Try a different provider, model, strategy or iteration cap
Fork from here The run’s saved state after one iteration Keep the early iterations and change what happens next, optionally with a different instruction

Rerun in the run header repeats the run exactly as saved, as a new run. The chevron beside it (Rerun with changes) opens the Rerun drawer first. Edit and rerun is a separate button that opens the launch form with the saved config for deeper edits.

The drawer offers four settings, each starting at the original run’s value:

  • Provider
  • Model (changing the provider resets the model to that provider’s default unless you pick one)
  • Reasoning strategy
  • Iteration cap (a whole number from 1 to 200; blank keeps the original)

A What will change summary lists each setting against the original (“Model llama3 to qwen3”), or says “Nothing. Rerun repeats the original exactly.” Nothing starts until you press Rerun in the drawer. Rerun is offered once the run has stopped and only for a run that recorded its launch config; a run recorded as a trace only has no config to start from.

Cortex run view with the Rerun with changes drawer open: Provider, Model, Reasoning strategy and Iteration cap fields, and a What will change summary showing the iteration cap going from 8 to 4. Cropped to show: The Rerun drawer with its four settings and the What will change summary.
Rerun with changes: the same task and saved config as a new run, with one thing changed. What will change lists each setting against the original. The Rerun drawer with its four settings and the What will change summary.

Each iteration row of a finished run has Fork from here. It opens the same drawer, titled “Fork from iteration N”, and starts a new run from the run’s saved state after iteration N. Iterations are numbered from 1, as in the trace, so a fork at iteration 3 continues from the state after iteration 3.

Every model call after the fork point is made again, live. Nothing after that point is replayed from the original run. The drawer adds an Instruction field, filled with the original task; edit it to send the model a different instruction from that point on.

Cortex run view with the Fork from iteration 2 drawer open: Provider, Model, Reasoning strategy, Iteration cap and an Instruction field holding an edited task, above the What will change summary.
Fork from here: a new run from the saved state after one iteration, with an instruction you can edit. Every model call after that point is made again.

In a fork the cap is Iterations after the fork point, not the cap from the start: the fork may run that many more iterations past the fork point (blank keeps the original run’s cap, now counted from the fork point). In the lineage header it reads “(2 iterations after the fork point)”.

A fork restarts from the run’s durable checkpoints, written by the harness at every iteration when durable runs are on (the Cortex default). Finished runs stay forkable at every iteration: the framework keeps every checkpoint by default (retention.compactCheckpoints is false). When the button is missing, the run cannot be forked. The reason is in plain words, for example that the run did not checkpoint (durable runs were off), that its checkpoint store is gone, or that no checkpoint exists that early. Runs made by an older version keep only their last iteration, so fork a newer run. A run that is still running cannot be forked: stop it or wait for it to end.

A run started this way names its origin in the header:

  • Rerun of <run id>, or Forked from <run id> at iteration N
  • What changed, for example “(model qwen3, iteration cap 4)” for a rerun, or “instruction edited” and “(2 iterations after the fork point)” for a fork
  • A Compare link that opens the origin and the new run side by side
Cortex run view of a rerun: the header reads Rerun of, the origin run's id and the changed iteration cap, with a Compare link, above the run's vitals, answer and trace.
Lineage: a rerun names the run it came from and what changed, with a Compare link to the pair.

The origin lists what came from it under Reruns (n), Forks (n) or Reruns and forks (n): each entry shows the new run, its kind, status, model, changes and a Compare link.

Cortex Compare runs page showing the release-notes run beside its rerun: status, model, iterations, tokens and cost for each, and the differences between the two.
Compare runs: the origin and its rerun side by side, with what differs between them.
  • The original run is never changed. Its config, trace and answer stay as recorded.
  • A rerun or fork starts through the same path as any new run. The saved config is checked again: the workspace folder must still exist, a Code Action strategy cannot be combined with approval-gated tools, and approvals and the safety hold come from that config.
  • Cortex stores only the origin id, the kind, the iteration and the non-secret changes (provider, model, strategy, iteration cap). It never stores the config in the lineage, so {{secret.*}} placeholders stay unresolved and no secret is copied. An edited fork instruction is recorded only as a flag (“instruction edited”); the new text becomes that run’s task.
Route Does
POST /api/runs/:id/rerun Starts a rerun. Optional body: { provider?, model?, strategy?, maxIterations? }
POST /api/runs/:id/fork Starts a fork. Body: { at, task?, provider?, model?, strategy?, maxIterations? } (maxIterations counts iterations after the fork point). at is a whole number, 0 or more, counted from the framework’s 0-based checkpoint numbering (the UI’s iteration N is at: N - 1)
GET /api/runs/:id/lineage What this run came from, the runs started from it, and whether it can be forked (and the reason when not)

Both start routes answer with the new run’s id and its lineage. They refuse with a plain-words error when the run is not found, has no saved config, the workspace is gone, the provider or strategy is unknown, or (fork) the run is still running or has no checkpoint at or before at.

Install

Bun (recommended)bun add reactive-agents
Node 22.5+npm install reactive-agents

Get notified on new releases

Release notes, about once a month.