Assay PR Agentsingle-pass review
Pages

Output and exit codes

AbstractA review ends in one of six states. The command line writes a JSON report to stdout and exits 0 or 2. With --post, or from the poller, it also publishes one comment on the reviewed head. This page lists every state, every field, and the comment's exact shape.

Six states

StateExit statusWhen
over-budget2The estimate is above the limit. The model was not called.
estimate0--estimate was given. The model was not called.
model-unavailable2The model failed, timed out, or returned an answer the reviewer rejects.
partial2A path was left out, or a check could not run.
reviewed0The model ran, and nothing is incomplete.
empty0There was no text to review, and nothing is incomplete.

The second line of every posted comment is one of these words.

The JSON report

cursor-review writes one JSON object to stdout. When it catches an error it writes nothing to stdout, and prints cursor-review: <message> on stderr.

KeyPresentHolds
providerAlwayscursor, claude or codex
sourceAlwaysThe change's address, or the repository path
headAlwaysThe full commit that was reviewed
modelAlwaysThe model named, or <provider>-default
estimated_input_tokensAlwaysThe estimate. 0 when there is no text to review.
max_input_tokensAlwaysThe limit in force
stateAlwaysOne of the six states
findingsAlwaysThe model's findings, at most three. Each has path, line, end_line, title and message.
omittedAlwaysThe sorted paths outside the review's coverage
checksAlwaysShellCheck, actionlint and any Go analysis. One entry per file, with its state, its findings, and a reason when it could not check.
static_checksWhen any ranHadolint, zizmor and OSV-Scanner. One entry per file, with its source (ci or local), its state, its findings and a reason.
cache_hitAlwaysWhether the model's answer came from the cache
model_invocationsAlwaysHow many model calls the review made: 0 or 1
model_usageAlwaysThe usage the provider CLI reported, or null
qualgenWith historyIts state, the advisories, the unscreened paths and the history_head
errormodel-unavailableWhat went wrong
cursor_team_idCursor with a teamThe team billed
publicationWith --postposted-or-already-present, or failed

Cost and coverage quotes a complete report from a real --estimate run, with each field annotated.

The posted comment

A review posts at most one comment, as an ordinary comment on the reviewed head. Its lines follow a fixed order:

  1. A header: the provider's name, then review of, then the full commit.
  2. The state.
  3. Each model finding: its path and line, then the finding's title and message.
  4. One line on what became of the model: Skipped <provider>. Estimated prompt <n> tokens exceeds the limit of <m>., or <provider> could not complete the review., or, when there are no findings, No model findings in the reviewed scope.
  5. Each local check that could not run, and the findings of those that did.
  6. A Static checks block: one count per tool, then up to 30 entries.
  7. A history block: its title, then up to 20 entries.
  8. Each path outside the review's coverage.
  9. A blank line, then credit to PR-Agent.

Where the backticks come from

Paths come from the pull request. Titles and messages come from the model. The comment sets each one as code, using a backtick run one longer than the longest run inside it.

A path chosen to look like a mention, or a message written to look like a link, is therefore posted as literal text. The reviewer's identity never posts a live mention or a link on a contributor's behalf.

A comment, assembled

The comment below is illustrative. Every line follows a template from the source, and the change is made up. It shows a review with one model finding, a check that could not run, a check finding, both blocks and one omitted path.

An illustrative comment for a partial review.
  1. Cursor review of 9c1f0ab2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8

    Comment 1, on line 1: The header: provider, then the full commit.

  2. partial

    Comment 2, on line 2: The state.

  3. src/app.py:42 — Unhandled None. parse() can return None.

    Comment 3, on line 3: A model finding. Path, line, title and message, each set as code.

  4. actionlint: could not check tool unavailable

    Comment 4, on line 4: A local check that could not run, with its reason.

  5. scripts/deploy.sh:12 — SC2086 Double quote to prevent globbing and word splitting.

    Comment 5, on line 5: A finding from a check that did.

  6. Static checks
  7. hadolint: 1 CI, 0 local, 1 findings, 0 incomplete.

    Comment 6, on line 8: Each tool's count: how many files came from CI, how many ran locally, the findings, the incomplete ones.

  8. zizmor: 0 CI, 1 local, 0 findings, 1 incomplete.
  9. hadolint (ci) Dockerfile:3 — DL3007 Latest tag used

    Comment 7, on line 10: One Hadolint finding, from a CI report.

  10. zizmor (local) .github/workflows/ci.yml — could not check: source unavailable or scanner failed

    Comment 8, on line 11: zizmor's one file could not be checked, so the review is partial.

  11. Qualgen history advisories (baseline 3b9e21c7d4a0)

    Comment 9, on line 14: The history block names the commit its history was mined from.

  12. src/app.py — reference-rot: historically coupled to partner.py
  13. docs/new.md — insufficient history or unable to screen
  14. Outside review coverage: docs/readme.md

    Comment 10, on line 18: A file the model never saw.

  15. Review tooling built on PR-Agent.

    Comment 11, on line 20: The only link the reviewer posts.

What a comment leaves out

LimitIn the commentIn the report
30 scanner entriesThen a line saying how many were omittedThe full list under static_checks
20 history entriesThen a line saying how many were omittedThe full list under qualgen
450 characters per scanner entry, 500 per history entryCutThe full text

Reading the exit status

Exit statusMeaning
0The requested review or estimate completed in full, including a review with findings
2Partial coverage, a budget refusal, a model or tool error, or a publication failure

Inspect state, checks and findings when a pipeline reads the report.