select
Analyzes the current git diff and returns the tests most likely to catch a
regression. This command prints the selection without executing tests. To select
and run tests in one command, use
momentic run --ai-select.
Base branch, tag, or commit to diff against
HEAD. Momentic detects the pull
request base in supported CI providers and otherwise falls back to
origin/HEAD.Soft cap on the number of tests selected. AI test selection can exceed it to
cover distinct changed behavior. If omitted, no test-count cap applies.
Additional selection guidance appended to the built-in AI test selection
instructions. Repeatable; values are appended in command-line order.
Maximum selection time in seconds. Minimum: 60. The selector reserves time to
finalize gathered evidence before the deadline. If it cannot recover a
selection, it returns a run-all fallback. Slow billing or telemetry does not
discard a completed selection.
classify
Classifies the result of a test run. The agent inspects step results,
screenshots, and error details and returns a category with reasoning.
For CI, prefer enabling classification in
momentic.config.yaml so momentic run classifies failures in-flow and saves the verdict automatically, with no
separate ai classify step. See Turn on in-flow
classification.
Use this command to re-classify past runs, batch-classify a run group or
commit, or ask follow-up questions with --interactive.--run-id (one or more run IDs or
URLs), --run-group-id (a run group ID or URL), or --git-commit. Multiple
failed runs are classified in parallel with an aggregated summary.
Options
Classify one or more runs by ID or full run URL (e.g.
https://app.momentic.ai/runs/<runId>). Pass multiple space-separated values
to classify several runs in one invocation. Multiple runs cannot use
--interactive.Classify every failed run in an uploaded run group, by run group ID or full
run group URL (e.g.
https://app.momentic.ai/run-groups/<runGroupId>).When targeting a run group or commit, skip runs that already have a saved
classification. Use it to resume a partially completed batch.
Number of runs to classify in parallel when targeting a run group or commit.
Defaults to
4. The run banner shows the effective value.Output format for the classification. Defaults to
text. Use json to print
only the structured payload to stdout.Persist the classification into the run’s metadata. For local runs, this
updates the local run zip; for uploaded runs, it updates the dashboard run.
When targeting a run group or commit, the command saves each run as it
finishes. New result-classification cache entries are written only when
--save is set and --no-cache is not set.Ignore prior result-classification cache entries and do not write new cache
entries. By default, classification can reuse prior classifications from the
result-classification cache. Without
--no-cache, --save also allows
successful classifications to write new cache entries for future runs.After classifying, stay in an interactive terminal chat with the
classification agent. Useful for asking follow-up questions about the run (why
a step failed, what the screenshots show, or related runs) without re-running
classification. Single-run only and requires a TTY; cannot be combined with
--run-group-id, --git-commit, or --output-format json. Type exit (or
Ctrl-C) to leave; Ctrl-C during a response cancels only that turn.Output
By default, the classification is printed as plain text:--output-format json to emit a machine-readable payload instead:
json payload is
an array, one entry per run; entries that failed to classify carry an error
field instead of a classification:
--skip-classified to retry
only the runs that did not complete.
Categories
The test is out of date because the application’s flow or UI has changed.
Updating the test to match the new behavior would permanently fix the failure.
Something went wrong in the application that shouldn’t have, such as an
unexpected error message appearing or expected content failing to render.
The test can be permanently updated to prevent the failure while still
validating its original intent, and a specific authorship change can be
recommended. Timeouts, slow page loads, and any failure whose recommended fix
is to wait longer or increase a timeout do not belong here. Those are
INFRA,
even when the test could technically be edited to wait longer.Missing test data or files necessary to run the test, where the fix requires
user action outside of the test itself (e.g. a missing file for a file upload
step, or missing/incorrect credentials).
A failure unrelated to the application or application code that was caused by
an infrastructure outage, long load times, or another outside factor.
An issue with Momentic’s own execution (e.g. incorrect cache entries,
unexpected locator redirects, obvious AI hallucinations).
triage
Runs the triage agent over a local results archive from
momentic run or an uploaded run group.
The agent investigates failures, groups them by shared fixes when possible,
attempts to update tests in place, and writes the outcome back to the run group.
momentic ai heal is an alias with the same behavior and flags.
When processing a local results archive, the command automatically uploads the
updated archive after processing so the dashboard and connected reporting
receive the final results and validation signal. Pass --no-save to skip
persisting triage metadata and uploading the local archive. This automatic
upload also runs after --dry-run triage.
For a copy-paste CI setup and the different integration paths, see Auto-heal
failing tests in CI.
[results] archive, --run-group-id,
--run-id, --git-commit, or --from-quarantine. When multiple runs are
passed via --run-id, they are triaged together in a single bucketing pass.
Arguments
Path to a local results archive directory written by
momentic run. The
directory must contain a run group metadata file. Omit when using
--run-group-id, --run-id, --git-commit, or --from-quarantine.Target and output
Triage an already uploaded run group by ID or full run group URL (e.g.
https://app.momentic.ai/run-groups/<runGroupId>) instead of a local results
archive. Automatic upload does not apply because there is no local archive.Triage one or more uploaded runs by ID or full run URL. Pass multiple
space-separated values to triage several runs together in one bucketing pass.
The command skips the run-group risk summary for this scope.
Triage every failed run recorded at the given git commit SHA, flat across all
run groups. The command skips the run-group risk summary for this scope.
Heal the active quarantine backlog instead of a specific results set. The
command processes quarantined tests earliest-quarantined first, replaying each
one’s most recent failed run. Tests whose stored heal status is Unhealable
are skipped with their diagnostics printed; clear the heal status from the
Quarantine board to retry one. Honors
--exclude. Cannot be combined with --only-quarantined,
--skip-quarantined, or --ignore-quarantine.Maximum number of quarantined tests to attempt in one
--from-quarantine
invocation. Scanning stops as soon as the budget is filled and the summary
reports how many tests were not attempted. Must be a positive integer.Group failed tests and generate a validation signal without attempting or
applying repairs. A local results archive is still uploaded by default. Add
--no-save to skip persisting triage metadata and uploading the archive.How an accepted repair is delivered. Accepts
pull-request,
draft-pull-request, direct-commit-except-main, patch (print a git patch
to stdout), or nothing (leave the changes on disk). Overrides the On
successful heal Triage setting
for this run.What happens to tests the agent cannot fix. Accepts
warn, fail, or
quarantine. Overrides the On failed heal Triage
setting for this run.After triaging, stay in an interactive terminal chat with the triage agent so
you can ask follow-up questions. This cannot be combined with
--json.Do not persist triage heal metadata to the local results archive or cloud
runs, or automatically upload the local archive. This does not prevent the
agent from editing test files or applying the configured repair delivery.
Deprecated alias for
--no-save. It also disables metadata persistence when
targeting uploaded runs or run groups.Common flags
Path to the Momentic configuration file. When omitted, Momentic searches the
current directory and its parents for
momentic.config.yaml or a workspace
configuration. Use this flag to select a project when discovery finds more
than one.When using workspaces, load the
project whose name matches the filter.
Number of healing attempts to run in parallel. Each attempt opens its own
browser session. Uses the project’s
parallel setting, then 1. Pass auto
to size concurrency from the host’s CPU count.Abort when the number of healable failed runs exceeds this threshold. Must be
a positive integer.
Exclude tests whose name or project-relative file path matches any of the
provided regex patterns from the triage queue. Provide multiple patterns
separated by spaces. A pattern only needs to match part of the name or path
for that test to be skipped.
Emits high-fidelity diagnostics for the triage agent so Momentic can help
debug your agent’s failure. Leave it off unless Momentic asks for it.
Environment
Browser
Launch healing browser sessions with a visible UI by default. Useful for
watching the agent work. Env:
MOMENTIC_HEADFUL_BROWSER. The legacy
--headful-browser flag remains an alias.Caching
Always save updated step caches after a successful heal, even on the main and
other protected Git branches.
Ignore previously cached heal solutions during triage so the agent heals
failures from scratch. It still saves newly successful heals; step caches are
unaffected.
Quarantine
Skip quarantined tests during triage. Disabled by default, so healing includes
quarantined failures.
Recovery
Skip tests that passed via in-run failure recovery instead of assessing
whether they need a permanent repair. Failed tests are still triaged.
Setup
Resource to wait for before the replay begins. Accepts anything supported by
wait-on.HTTP proxy used when polling
--wait-on. Provide the full URL including
protocol, optional credentials, host, and port.Timeout (in seconds) for
--wait-on. Defaults to 60. Triage fails if the
resource is not reachable in time.CI
Maximum total triage time, in minutes. When reached, in-flight healing
attempts stop and the command writes the current results.
Exit codes
triage is the final status for a run group: a non-zero exit code means
failures or errors remain.
0: every failure was either successfully healed or, when On failed heal iswarn, logged as a warning. A successful heal does not fail the run on its own; you review and merge the delivered fix (e.g. a pull request).1: a test could not be healed and On failed heal isfailorquarantine, or delivering an accepted repair failed (e.g. opening the pull request errored), or the triage run itself errored out.