Assay PR Agentsingle-pass review
Pages

Cost and coverage

AbstractEvery review is estimated before anything is sent to the model, refused over a limit you set, capped at one model call, and cached. Whatever it could not check is written into the report instead of being left out.

The estimate comes first

--estimate makes zero model calls. It performs the same diff preparation and static checks as a review, and reports what the complete prompt would cost.

The estimate covers the whole prompt: the review rubric, a fixed instruction, the scanner evidence that sits on lines the patch shows, and the line-numbered patch itself. PR-Agent's token estimator counts it.

A real estimate

The run below is real. --estimate was run on a throwaway repository with a two-file change: a shell script that leaves two variables unquoted, and a workflow that passes a pull request title into an inline script. ShellCheck and actionlint found all three problems. No model was called.

A real --estimate on a throwaway repository.
Command
cursor-review --repo /tmp/example --base main --estimate
Exit status
0
Length
1,419 estimated tokens against a limit of 6,000
Findings
3: one from actionlint, two from ShellCheck, none from a model
Coverage
Both changed files were checked in full. No path was left out.
  1. {
  2. "provider": "cursor",
  3. "source": "/private/tmp/example",
  4. "head": "1a64c12013445ed5cfcb8679b73c5ab5c2d9f02f",
  5. "model": "cursor-default",
  6. "estimated_input_tokens": 1419,

    Comment 1, on line 6: The whole prompt, counted before anything is sent: 1,419 tokens, against the limit on the next line.

  7. "max_input_tokens": 6000,
  8. "cursor_invocations": 0,

    Comment 2, on line 8: No model was called. --estimate prepares everything a review prepares, and stops.

  9. "cache_hit": false,
  10. "omitted": [],

    Comment 3, on line 10: No path was left out. Every changed file had a usable patch.

  11. "checks": [
  12. {
  13. "tool": "actionlint",
  14. "path": ".github/workflows/ci.yml",
  15. "state": "complete",
  16. "findings": [
  17. {
  18. "path": ".github/workflows/ci.yml",
  19. "rule": "expression",

    Comment 4, on line 19: actionlint's finding: a pull request title passed straight into an inline script.

  20. "line": 11,
  21. "message": "\"github.event.pull_request.title\" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details"
  22. }
  23. ]
  24. },
  25. {
  26. "tool": "shellcheck",
  27. "path": "deploy.sh",
  28. "state": "complete",
  29. "findings": [
  30. {
  31. "path": "deploy.sh",
  32. "rule": "SC2086",

    Comment 5, on line 32: ShellCheck's: two unquoted variables, on lines 4 and 5.

  33. "line": 4,
  34. "message": "Double quote to prevent globbing and word splitting."
  35. },
  36. {
  37. "path": "deploy.sh",
  38. "rule": "SC2086",
  39. "line": 5,
  40. "message": "Double quote to prevent globbing and word splitting."
  41. }
  42. ]
  43. }
  44. ],
  45. "findings": [],

    Comment 6, on line 45: Model findings. Empty, because no model ran. The scanners' findings sit under checks.

  46. "cursor_usage": null,
  47. "state": "estimate",

    Comment 7, on line 47: The state decides the exit status. estimate is 0.

  48. "model_invocations": 0,
  49. "model_usage": null
  50. }

When the estimate is too large

An estimate above the limit ends the review before the model is invoked. The state is over-budget, the exit status is 2, and the static checks and history advisories are still reported.

The overview quotes one such review from the project's own pull request #15. Thirty-five minutes later the same pull request was reviewed again at a later head:

The second comment on that pull request, on GitHub.
Manuscript
medici-finance/assay-pr-agent#15, revision c609020; posted by assay-pr-agent[bot] on 26 November 2026
Recommendation
Not reviewed: over budget
Length
12,645 estimated tokens against a limit of 6,000
Findings
None. Hadolint found nothing at this revision.
Coverage
The model review was skipped. History was unavailable.
  1. Codex review of c609020b9ec08fa35e18dea33f5dfd7db779b837
  2. over-budget
  3. Skipped Codex. Estimated prompt 12645 tokens exceeds the limit of 6000.

    Comment 1, on line 3: Still over the limit, and larger: 12,645 estimated tokens.

  4. Static checks
  5. hadolint: 0 CI, 1 local, 0 findings, 0 incomplete.

    Comment 2, on line 6: No findings this time. The Dockerfile problems of the earlier head had been fixed, and the scan says so.

  6. Qualgen history unavailable for this review.
  7. Review tooling built on PR-Agent.
  8. On-behalf-of: human:review-operator mode:unattended

Repeat --path path/to/file to review an exact changed path, or split the change.

Where the limit comes from

The limit is 6,000 estimated input tokens by default. Three things can change it, and the first one found wins:

SourceScope
--max-input-tokensOne run
REVIEW_MAX_INPUT_TOKENS in the environmentThat container
The REVIEW_MAX_INPUT_TOKENS setting saved by setupThe saved setup, which the wizard asks for
6,000When none of the above is set

One call, at most

Each run can launch the provider CLI once, with a 120-second timeout and at most three accepted findings. There is no model fallback, repair prompt, automatic retry or model polling.

The cap covers the prompt the reviewer submits. The CLI controls its own system context, its own output and its own billed usage. model_usage is filled in only if the CLI supplies it.

The cache

A successful result is cached, and a repeated request does not pay again.

Where it livesWhen
~/.cache/cursor-pr-review, or under XDG_CACHE_HOMEThe command line on its own
/state/cacheReviews run by the poller, which passes --cache-dir

The container image sets XDG_CACHE_HOME=/tmp/.cache, because its root filesystem is read-only. That covers a cursor-review run by hand inside the container.

A result is reused when all of these match the earlier run:

  • The prompt: the same patch and the same scanner evidence.
  • The scope, and the model.
  • The source, meaning the change's address or the repository path.
  • The provider, and for Cursor the team.

The commit's SHA is not among them. A new commit that leaves the patch unchanged hits the cache.

A lock serializes duplicate local requests. For CI reuse across jobs, provide a persistent, trusted --cache-dir; each ephemeral runner otherwise starts cold. Use an explicit model for results you can compare.

Coverage

A review can come back with less than was asked for, and says so each time.

Written in the reportWhen
A path under omittedA file has no usable patch or no head-side location, as for a whole-file deletion, or was excluded by --path.
A check with the state could-not-check, and a reasonA scanner could not run. Static checks lists the reasons.
Outside review coverage in the commentAny omitted path, repeated where people read it.

Scanner findings are kept apart from model findings in the JSON. Missing scanner evidence stays visible even when the model finds nothing. Whenever anything is omitted or could not be checked, the state is partial and the exit status is 2.

Exit status

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

Output and exit codes lists the six states behind them and every field of the report.