Skip to main content

At a glance

  • Precedence: a per-run opt-in (CLI flag, action input, or API autoHeal) takes priority over project-wide auto-heal settings for that run.
  • Target branch: branch is one branch in the tests repository. Defaults to the run’s recorded branch. If the run came from app-code CI, set it to the tests repo’s integration branch (often main).
  • Output: a PR from a generated checksumai/<id> branch into branch, when autoCreatePR is true (the default).
  • Honest triage: real product bugs get a bug verdict and an @bug tag instead of being rewritten to go green.
  • Sharding: a merged sharded run that ends failed is healed. If shards never merge (checksumai older than 4.4.0), the heal is never evaluated.
Developer guide
Trigger healing from the CLI, CI, the REST API, or MCP, and control where the fix PR lands

Choose how to start healing

There are two moments to ask for healing. You can opt in when you start a run, so healing kicks off on its own if the run fails. Or you can heal a run that already finished. Checksum can also turn healing on for every CI run in your project. If a run has its own opt-in (a CLI flag, an action input, or an API autoHeal block), that takes priority over the project-wide setting for that run.

Heal failures from the CLI

Add --cksm-auto-heal to your test command. If the run fails, Checksum heals the failing tests and, by default, opens a PR with the fixes:
In GitHub Actions and GitLab CI, the repository, branch, and PR number are detected automatically, so --cksm-auto-heal alone is usually all you need. Outside CI, you can set them yourself with the extra flags in the reference below.
Auto-detection of repo, branch, and PR number works in GitHub Actions and GitLab CI.

Heal failures from the GitHub Action

Set auto-heal: true on the Checksum action. The action works out the PR and repository from the workflow, so healing progress appears as a comment on the PR that triggered it:
If you also shard the run with shard-count, you need action v2.1.0 or later. When the workflow runs from application code, set the action’s branch input to your tests repo’s integration branch so the heal PR lands there (see Choose where the fix PR lands). More in CI/CD Integration, or have a coding agent build the workflow with CI Setup Prompts → Prompt 1.

Heal every failing CI run

Enabled by ChecksumChecksum can turn on automatic healing for your project so every failing CI run is healed without per-pipeline flags. Ask your Checksum team to enable it. Scheduled runs can be healed the same way (a project-level setting).
Once it’s enabled, mark your CI pipelines so Checksum knows their runs are CI runs:
The repository, branch, and PR number are picked up from the CI environment.

Heal from the REST API

From the API you can either ask for healing as part of starting a run, or heal a run afterward. Either way you get a healing batch to follow. Every request sends Authorization: Bearer $CHECKSUM_API_KEY.

Heal automatically if a run fails

Add an autoHeal block to the request that starts the run (any of the execution endpoints). If the run ends failed, Checksum starts healing on its own; there’s no second call. Leave the block out to opt out.
The block can carry the same options as a heal request (whether to open a PR, which branch, which PR to comment on, and extra context), for example:
Then follow the run with GET /execution/status/run/{runId}. It also works with sharded runs: once the shards merge, a failed run is healed.

Heal a run that already finished

If a run finished without autoHeal, ask for healing afterward. Pass the run’s ID (the runId from when you started it, or the id of the latest run), not its job name:
Checksum starts a healing session for the failing tests and returns a batchId. Because it opens a PR by default, include repoName unless you set "autoCreatePR": false.

Follow healing progress

Check the batch every so often until allTerminal is true. Each session’s prUrl links the fix PR once it opens.
The batch moves from pending to in_progress and ends as completed or failed. Generation batches report progress in the same shape, without testRunId and sessions[].checksumTestId.
Needs curl, jq, CHECKSUM_API_KEY, and REPO set to the <owner>/<repo> used for status comments. Set TESTS_BRANCH to your tests repo’s integration branch.
Headers on every request: Authorization: Bearer $CHECKSUM_API_KEY; with a body, Content-Type: application/json.

autoHeal block (execution request bodies)

Accepted on POST https://api.checksum.ai/public-api/v1/execution/suite, POST https://api.checksum.ai/public-api/v1/execution/collection/{id}, POST https://api.checksum.ai/public-api/v1/execution/tests, POST https://api.checksum.ai/public-api/v2/execution/grep. Presence means heal-on-failure: if the run ends failed, a healing batch starts with no separate call. Omit to opt out.On grep runs, top-level branch = what is checked out for the test run; autoHeal.branch = where the heal PR lands. Works with shardCount: the merged run is healed; if shards never merge (outdated checksumai), the heal is never evaluated. Next: poll GET /execution/status/run/{runId}.

POST https://api.checksum.ai/public-api/v1/auto-heal

Starts healing for the failing tests in a finished run.Next: poll the batch.

GET https://api.checksum.ai/public-api/v1/auto-heal/batch/{batchId}

Returns the progress of a healing batch. Generation batches (GET /auto-generate/batch/{batchId}) return the same shape, minus testRunId and sessions[].checksumTestId. Path parameter batchId (string, required): the batch ID returned by the trigger. Poll until allTerminal is true.

Choose where the fix PR lands

Healing always works in your tests repository. The branch you pass is the one branch healing clones, commits to, and opens its PR against; the PR comes from a generated checksumai/<id> branch. If you don’t pass one, Checksum uses the branch the run was recorded on. That only works when the run executed against a tests-repo branch. If the run came from your application’s CI (on a branch like feature/foo), set branch to your tests repo’s integration branch, often main. These settings behave the same on POST /auto-heal, the autoHeal block, and the CLI flags.

Choose where progress is posted

Separately, prNumber and repoName tell Checksum which pull request should receive progress comments while healing runs. They don’t change what’s cloned or where the fix PR lands. Usually they point at the PR in your application repo that triggered the CI run, but they can point at the tests repo if the source PR is there.

Where healing runs (tests repository)

With autoCreatePR: true, the PR opens from a generated checksumai/<id> branch into branch. Same semantics on POST /auto-heal, the autoHeal block, and --cksm-auto-heal-branch. On grep runs, a top-level branch controls the run’s checkout, not the heal PR target.

Where to post status (correlation only)

Ask your coding agent to heal

With the Checksum MCP server connected, just ask:
Your agent finds the failed run if you don’t name one, then starts one healing session covering every failing test in it and, by default, opens a PR with the fixes. Healing works from a run that already finished, so there’s nothing to push first. If the run has nothing to heal, it tells you why. You can ask for progress or send extra instructions while it works, and ask for Deep mode if you want to approve a plan first.
▦
In the Checksum web app
Start healing from the dashboard and follow it to the PR

Heal from the Feature Health Dashboard

From the Feature Health Dashboard

From a bug row or an expanded bug, start healing (or another agent workflow) on the grouped set of failures. From any test row, start an agent session for that single test when your project has agent workflows enabled. See Agent actions. Each healing session appears under Agent Sessions. Tests under healing show Under Healing on the dashboard.

Test states while healing

While healing runs, each test on the dashboard is in one of three states:
i
How it works
Triage, healing modes, what gets fixed, and reviewing the PR

How healing works

Auto-healing flow: failing run, triage, fix, verify, PR
Failing runTests failed and couldn’t be recovered at runtime
→
TriageEach failure classified as a test issue or an app bug
→
FixTest issues repaired and re-run to verify
→
PRHealed tests delivered to your tests repo

Triage: bug or healable?

The agent’s first step is to triage every failure in the run. For each failing test it:
  1. Reads the test results and error context (screenshots, error messages, stack traces)
  2. Reads the relevant test code and application code
  3. Classifies the failure:
    • Test issue: the app is fine but the test needs fixing (selector drift, timing, stale setup, assertion drift). These go on to the fix stage.
    • Application bug: a real defect in your product. The agent submits a bug verdict and tags the test @bug in source. It’s tracked in the Feature Health Dashboard for your team.
If triage finds nothing test-side to fix (every failure is an app bug, or nothing failed), the fix stage is skipped.
Healing is honestIf a test fails because your app genuinely broke, healing reports a bug. It doesn’t rewrite the test to go green.

Deep vs Standard healing

Triage → Fix

Triage classifies each failure and submits verdicts for real bugs. Fix repairs test-local issues (selectors, timing, setup, assertions), runs the tests to verify, and commits. Best for selector changes, timing fixes, and minor assertion updates.

Plan first, then repair

Interview/Plan → Knowledge Base Update → Implementation → Review → Checksumify → Verify. The agent plans the fixes and learns what changed in your app before repairing. Best for major refactors, flow changes, and many related failures.

What the agent fixes

Review healed tests

1

Read the diff

See what changed and why. The PR description explains each fix.
2

Run locally (optional)

Check out the checksumai/<id> branch and run the affected tests.
3

Merge

Once merged, the tests are green again, and the dashboard shows them as Clear.

Healing feedback

After reviewing healed tests, you can give feedback on the quality of the healing. Checksum uses it to improve healing accuracy over time.

Notifications

Healing batches emit two events you can route to Slack, Teams, Discord, or Google Chat with notification connectors:
RoutingNew connectors don’t route any events until you turn them on. Enable Auto-Heal Started and Auto-Heal Completed for each connector in the routing matrix. See Notifications & Slack.

Troubleshooting

The run came from app-code CI, so its recorded branch (e.g. feature/foo) doesn’t exist in the tests repo. Set branch / autoHeal.branch / --cksm-auto-heal-branch to your tests repo’s integration branch.
autoCreatePR defaults to true, which requires repoName. Pass it, or set "autoCreatePR": false without prNumber.
testRunId must be the run UUID (runId), not the dispatch name. For v2 grep runs polled by job name, use the testRunId field from GET /public-api/v2/execution/status/:jobName. See Which ID is which.
Triage may have classified every failure as an application bug. Check the Feature Health Dashboard. Also check whether autoCreatePR was false.
The shards never merged, usually because checksumai is older than 4.4.0, so autoHeal was never evaluated. See Sharding.

Auto-Recovery

Runtime fixes during execution.

Feature Health Dashboard

Bugs found by triage.

CI/CD Integration

Heal failing CI runs automatically.