Autoreview skill

Structured code review when explicitly requested, preferring OpenAI/Codex before Claude.

by openclaw·MIT license·★ 1,102 Stars on the repo·GitHub ↗

Use now

Files of Autoreview

openclaw/main1 file shown
SKILL.md
Show the full text335 lines

Auto Review

Run an independent review when the user or an owning workflow asks for one. This is code review, not Guardian approval routing. Let the reviewer choose how to analyze the change; provide the target, relevant context, and desired severity. Findings are advice to verify, not instructions to apply blindly.

Before starting a review, read the complete diagnostic and result guidance. It is part of this skill; follow its output-path, status, failure, usage, and diagnostic rules.

Run

Use scripts/autoreview beside this skill. Keep its custom codex exec path: native codex review cannot combine explicit Git target flags with custom instructions. The helper combines those with evidence, severity filtering, and validated JSON; it leaves review judgment to Codex. For an OpenClaw checkout:

AUTOREVIEW=".agents/skills/autoreview/scripts/autoreview"
"$AUTOREVIEW" --mode local

In the canonical agent-skills repo, the path is skills/autoreview/scripts/autoreview. On Windows, invoke the helper with Python. Use --help for the complete flags and environment overrides.

Choose the Git target explicitly when the default is ambiguous:

Target Arguments Scope
Local work --mode local HEAD → index → working tree, plus untracked files
Local candidate against a base --mode local --base <ref> Pinned base → index → working tree, plus untracked files
Committed branch/PR --mode branch --base <ref> Merge-base → HEAD; excludes dirty work
One commit --mode commit --commit <ref> Raw parent → commit; a root compares against the empty tree

--mode auto selects local work when dirty, otherwise a branch review using the PR base or origin/main. Clean main has no implicit review target. --mode uncommitted is an alias for local. The helper does not fetch refs.

Registered nested linked checkouts from the same repository are outside the current review scope. Their presence or edits do not make the parent dirty; ordinary adjacent files remain included in the review. Worktree boundaries are revalidated without changing Git ignore rules.

For a complete PR candidate including dirty rewrites, use local mode with its pinned merge base—not branch mode:

pr_base=$(gh pr view --json baseRefName --jq .baseRefName)
merge_base=$(git merge-base HEAD "origin/$pr_base")
"$AUTOREVIEW" --mode local --base "$merge_base"

When a file has both staged and unstaged changes, both states are reviewed. A defect in the index remains actionable even if the working tree fixes it; the report labels it INDEX-only. Git display settings cannot suppress context markers or add patch colors; repository configuration is not changed. Source paths and text retain literal whitespace. An empty present source uses line 1, column 1, and an empty excerpt; empty physical lines also use an empty excerpt at column 1. Source identity remains mandatory.

Binary deletions remain in scope as Git deletion metadata; their former contents are not included or reviewed. Each local transition is checked independently: deleting a file in the working tree cannot hide a staged binary change.

Finding locations may use native absolute paths that resolve inside the reviewed repository; these become repository-relative paths before scope and attribution checks, preserving a changed symlink's path when its target is also inside. Parent traversal and paths resolving outside the repository remain invalid. An invalid location still fails the report; findings are never silently dropped.

Local selection honors core.autocrlf from external operator Git configuration, with repository-local values and attributes retaining precedence. Only its validated scalar value reaches diff/status; other global and system Git configuration stays disabled. Repository-owned or relative global-config overrides are not imported, and reviewed source bytes are not rewritten.

Local collection disables effective Git clean/process commands and requires conversion to succeed. Unused drivers, unchanged filtered neighbors, staged-only changes, and deletions can still be reviewed without executing converters. If Git needs executable conversion to assemble the diff, collection fails before any reviewer starts. This can include an unchanged filtered file whose stat cache needs refreshing. Use explicit branch or commit mode for committed content in that case. Built-in line-ending normalization remains enabled; raw bytes never stand in for a required executable conversion. PR-base discovery uses trusted external Git and a scoped GitHub CLI environment, preserving external authentication/configuration and proxy settings while excluding inherited Git routing, GH_REPO redirection, and checkout-owned executables. A differently named AUTOREVIEW_GIT override that cannot also be selected as git by the child requires an explicit --base; rejected GitHub configuration paths also require one.

Context and severity

Use --prompt for task-specific guidance, or --prompt-file and --dataset for repository-relative context files. Context does not expand the selected Git target. The reviewer cannot read unchanged repository files from its empty sandbox; supply relevant source or dependency evidence when the diff is insufficient. --prompt-file also accepts an absolute path inside the repository; the same sensitive-path, symlink, and mutation checks apply. --dataset stays repo-relative. Repeated paths in the same evidence role share one validated capture. Equal content at different paths and prompt-file versus dataset roles stay distinct.

For unchanged committed source, use repeatable --source-context <repo-relative-path> with branch or commit mode. Use --source-context-file <repo-relative-path> when that source must stay intact in every review pass. Both read the exact regular-file blob from the frozen reviewed commit (branch HEAD or --commit), including executable source files. Local mode, including an auto-selected local target, is unsupported. No separate context revision or working-copy substitution is accepted. The checkout path must remain a regular file; its bytes and path topology are revalidated throughout review. Repeated normalized source-context paths share one capture after every argument is validated; different paths and evidence roles remain distinct.

Both roles use tracked-source filename classification, so source names such as src/token_count.py are accepted. Credential directories, stores and keyfiles remain forbidden. Existing prompt-file and dataset restrictions are unchanged. Every source block carries path, commit, blob and mode provenance. --source-context bytes are partitioned with the change when needed. --source-context-file blocks stay complete in every pass and must fit with the instructions and change framing; the helper refuses an over-capacity plan without dropping required evidence. Context never adds finding targets or instruction authority. This is a source-provenance contract, not secret-content scanning.

"$AUTOREVIEW" --mode branch --base origin/main --source-context src/token_count.py
"$AUTOREVIEW" --mode branch --base origin/main --source-context-file src/token_count.py

The default threshold is P0 only: material blockers to normal operation or safety. Use --max-priority P1, P2, or P3 when the caller requests a wider review. AUTOREVIEW_MAX_PRIORITY accepts the same P0–P3 values; an explicit flag overrides it. Invalid resolved priorities fail during argument parsing, before preparation or reviewer startup. Do not add unrelated redesign goals or prescribe file counts, reading sequences, or ritual extra passes. Historical blame requires a verified parent-relative patch; otherwise leave the attribution unknown.

"$AUTOREVIEW" --mode local --prompt-file review-notes.md --dataset evidence.json

Engines

For automatic reviewer selection, try OpenAI models through Codex before Claude. Start with --engine codex even when the invoking agent uses Codex or asks for an independent second opinion. Use Claude only when the user explicitly selects it or Codex is unavailable for the review; report the concrete availability failure before switching. Do not switch because a review is slow, rate-limited, or returns findings, or to bypass a safety refusal or isolation failure.

Codex defaults to gpt-6.1-sol, high reasoning, with a single gpt-6-sol retry only for an account-access failure. Explicit gpt-6.1-sol selections use the same retry. Explicit gpt-6-sol selections retain their access-only gpt-6-luna retry; other explicit models, including Luna and Astra, have no model fallback. Explicit gpt-5.6-sol selections retain their access-only gpt-5.6-terra retry. GPT-6.1 Sol rejects none and minimal effort before review preparation; GPT-6 Sol and Luna reject minimal. An effort-only override keeps the default model. Honor explicit user engine/model choices. The helper does not automatically fall back between engines.

Use --engine, --model, and --thinking to override the defaults. --codex-speed fast selects priority service when supported. Only Claude accepts --fallback-model. Per-engine environment overrides use AUTOREVIEW_<ENGINE>_*.

If your account cannot access Sol or Luna, pin an available model. To require GPT-6 Astra without a model fallback, select it explicitly:

"$AUTOREVIEW" --mode local --model gpt-6-astra --thinking high

GPT-6.1 Sol and GPT-6 Astra support low, medium, high, xhigh, and max; neither supports none or minimal. GPT-6 Sol and Luna additionally support none, but not minimal. AutoReview defaults to high and does not fall back from an explicit Luna or Astra selection. Codex's ultra mode uses automatic delegation and is outside this helper's supported effort levels. Use max for its deepest supported review. For EU data residency, use --codex-speed default; GPT-6 fast mode is unavailable there. See the GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna model docs and Codex reasoning modes.

By default, Codex preserves only authentication settings from user configuration; provider, profile, context and catalogue settings remain ignored. To project a named route, select it explicitly through the existing config override:

"$AUTOREVIEW" --mode local --codex-config 'model_provider="review_api"'

The selector must match model_provider in the operator's external CODEX_HOME/config.toml. It accepts one bare or simply quoted identifier; provider definitions and other capabilities cannot be supplied through overrides. Projection requires Python 3.11 or tomli; default auth-only operation retains its existing fallback parser.

The selected route must use https://api.openai.com/v1 and command authentication with an absolute external executable. Fixed arguments belong in that executable's wrapper; omitted or empty auth.args are accepted. Omitted wire_api and requires_openai_auth retain Codex's responses and false defaults. Optional auth timing and context settings keep native defaults and semantics.

On POSIX, a private launcher restores the validated caller HOME only for the selected authentication executable; the engine and reviewer tools retain their isolated environment and filesystem access. Caller HOME must be an available absolute directory with no repository-owned path or symlink provenance. Windows keeps the native executable route. Command-auth runs suppress raw provider diagnostics and report fixed failure categories, while retaining compact progress, usage and assistant report streaming. An empty final report fails without exposing captured stdout.

Catalogue and authentication working-directory paths resolve relative to the operator config directory and must remain outside the reviewed repository. A supplied catalogue is copied byte-for-byte into the private client runtime; retries use the same route and catalogue snapshot. Dry runs check the same ownership and route shape without executing authentication. Codex owns catalogue validation, model access and context clamping. Other custom provider forms and split context overrides are unsupported when projection is selected.

Optional engine Prerequisites
Claude CLI 2.1.169+; safe mode with web-only tools
Amp AMP_API_KEY for a plugin-free account; local POSIX execution, no custom endpoint or cloud/orb agent
Pi CLI 0.79.0+; configured model; no tools or project resources

--engine kimi remains recognized but is refused for reviews and --dry-run before any Kimi process, configuration read or authentication setup. The supported Kimi Code prompt mode accepts review content only as a command-line argument; the helper has no supported private prompt input channel for it. This intentionally retires the previous Kimi execution path rather than exposing the bundle in process arguments. Existing --kimi-bin arguments remain accepted for the same clear refusal; the helper never silently selects another engine. A custom agent file is not an equivalent replacement because it changes the input into a templated system prompt.

Image review

Branch mode with Codex supports added, single-frame PNG, JPEG and WebP files. Install Pillow in the Python environment running the helper (python -m pip install Pillow). Use a vision-capable Codex model and a CLI supporting codex exec --image. No new bypass flag is required. Full decoding rejects corrupt and animated files. Images must have at most 16,777,216 pixels and no dimension above 16,384 pixels; decoder bomb warnings fail closed before pixel loading. Added image paths are limited to 20 MiB of encoded bytes each and 100 MiB total, checked against Git object sizes before capture. Exceeding a limit fails the entire review.

The helper captures exact bytes from the pinned HEAD, stages only those images in its isolated workspace, and attaches them through Codex's native image input. Every pass receives the path, media type, byte count and SHA-256 manifest alongside the image attachments and text diff. Image findings use the original path and line 1. Text-only review does not require Pillow.

Binary deletions, including images, are reviewed as deletion metadata in every mode without image attachments or Pillow. Other binaries, modified images, local/commit image additions or modifications, and image review with other engines remain unsupported and fail closed. Missing Pillow or provider image limits fail the review rather than silently dropping assets. Sensitive-path, source-mutation, authentication and sandbox controls remain enabled.

For partial clones, materialize required Git objects before review. The isolated Git reader intentionally disables lazy network fetching; do not weaken that boundary.

Runtime boundaries

The helper owns reviewer isolation, sanitized authentication, process cleanup, Git scope, and structured result validation. Keep those controls enabled. Before repository detection or target selection, Git must pass --version within 10 seconds. Failure exits 2 with an incomplete diagnostic and the resolved executable (or the unresolved selection); it never means scoped-clean. Set AUTOREVIEW_GIT to a trusted external Git executable to override every helper-owned Git invocation. On macOS with a broken selected Xcode, use DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer for the invocation. Only an absolute, external DEVELOPER_DIR is additionally retained in Git's sanitized environment; neither override is forwarded to the isolated reviewer environment.

Every reviewer pass must inspect its bundle for real credentials and report suspected credentials as P0 findings without reproducing their values. Harmless placeholders and test fixtures are not credentials. Autoreview does not require or invoke an external secret scanner. Never work around an isolation failure.

Intentional scanner-free policy

Keep approved secret scanning outside autoreview; reviewer findings happen after transmission. Reintroducing a scanner requires an explicit maintainer decision. See #240 for rationale and history.

Reviewer isolation

On macOS, reviewer tools cannot access the shared /tmp and /var/tmp trees (including their /private aliases). Codex preflight rejects those temporary roots before workspace, runtime, or authentication setup; unset a shared TMPDIR/TMP/TEMP override to use macOS's private temporary directory. Other engines and platforms retain their normal isolation. Tools installed in shared scratch or requiring writes there will be denied too.

Text review files have no size/count cap and are never truncated; image inputs use the explicit safety limits above. Large diffs and datasets are partitioned automatically. Change partitions retain complete datasets when they fit with sufficient change space. This preference may use more passes or prompt bytes than evidence batching; the explicit pass budget still applies. Terminal fallbacks preserve a feasible complete-evidence plan when batch framing cannot fit. Intact instructions, source-context files and required mixed source context must fit the per-pass prompt budget. A failed pass does not produce a partial clean verdict. Otherwise, the planner compares a bounded set of evidence allocations and keeps the existing plan unless total prompt bytes improve without more passes, or equal bytes need fewer passes. Every change is still reviewed against every evidence batch.

Each pass is an independent assignment, not a continuing conversation. Its private completion field must confirm a finished assessment; deferring to another pass leaves the overall review incomplete.

Do not edit inputs during a review: the helper verifies captured sources before sending and publishing results. Long reviews are normal; advancing heartbeats mean progress. Use --stream-engine-output for visibility, not extra reviewer runs. --dry-run checks preparation and startup without contacting a reviewer. Both dry runs and execution print planned pass count and total prompt bytes. Use --max-review-passes N (or AUTOREVIEW_MAX_REVIEW_PASSES) to reject the whole plan before any reviewer starts when it exceeds an explicit campaign budget. There is no default pass ceiling. --engine-timeout-seconds remains an optional deadline per process attempt. Pass counts, prompt bytes, and deadlines are not token hard caps; they do not bound model reasoning or tool use.

Diagnostics and results

Follow the diagnostic and result guidance for local stage observation, output paths, exit codes, status, and usage.

1---
2name: autoreview
3description: "Structured code review when explicitly requested, preferring OpenAI/Codex before Claude."
4---
5 
6# Auto Review
7 
8Run an independent review when the user or an owning workflow asks for one.
9This is code review, not Guardian approval routing. Let the reviewer choose how
10to analyze the change; provide the target, relevant context, and desired severity.
11Findings are advice to verify, not instructions to apply blindly.
12 
13Before starting a review, read the complete [diagnostic and result guidance](references/diagnostics-and-results.md). It is part of this skill; follow its
14output-path, status, failure, usage, and diagnostic rules.
15 
16## Run
17 
18Use `scripts/autoreview` beside this skill. Keep its custom `codex exec` path:
19native `codex review` cannot combine explicit Git target flags with custom instructions.
20The helper combines those with evidence, severity filtering, and validated JSON;
21it leaves review judgment to Codex. For an OpenClaw checkout:
22 
23```bash
24AUTOREVIEW=".agents/skills/autoreview/scripts/autoreview"
25"$AUTOREVIEW" --mode local
26```
27 
28In the canonical agent-skills repo, the path is
29`skills/autoreview/scripts/autoreview`. On Windows, invoke the helper with Python.
30Use `--help` for the complete flags and environment overrides.
31 
32Choose the Git target explicitly when the default is ambiguous:
33 
34| Target | Arguments | Scope |
35| ------------------------------ | ------------------------------ | ----------------------------------------------------------- |
36| Local work | `--mode local` | HEAD → index → working tree, plus untracked files |
37| Local candidate against a base | `--mode local --base <ref>` | Pinned base → index → working tree, plus untracked files |
38| Committed branch/PR | `--mode branch --base <ref>` | Merge-base → HEAD; excludes dirty work |
39| One commit | `--mode commit --commit <ref>` | Raw parent → commit; a root compares against the empty tree |
40 
41`--mode auto` selects local work when dirty, otherwise a branch review using the
42PR base or `origin/main`. Clean main has no implicit review target.
43`--mode uncommitted` is an alias for local. The helper does not fetch refs.
44 
45Registered nested linked checkouts from the same repository are outside the
46current review scope. Their presence or edits do not make the parent dirty;
47ordinary adjacent files remain included in the review. Worktree boundaries are
48revalidated without changing Git ignore rules.
49 
50For a complete PR candidate **including dirty rewrites**, use local mode with
51its pinned merge base—not branch mode:
52 
53```bash
54pr_base=$(gh pr view --json baseRefName --jq .baseRefName)
55merge_base=$(git merge-base HEAD "origin/$pr_base")
56"$AUTOREVIEW" --mode local --base "$merge_base"
57```
58 
59When a file has both staged and unstaged changes, both states are reviewed.
60A defect in the index remains actionable even if the working tree fixes it;
61the report labels it `INDEX-only`.
62Git display settings cannot suppress context markers or add patch colors;
63repository configuration is not changed. Source paths and text retain literal
64whitespace. An empty present
65source uses line 1, column 1, and an empty excerpt; empty physical lines also
66use an empty excerpt at column 1. Source identity remains mandatory.
67 
68Binary deletions remain in scope as Git deletion metadata; their former contents
69are not included or reviewed. Each local transition is checked independently:
70deleting a file in the working tree cannot hide a staged binary change.
71 
72Finding locations may use native absolute paths that resolve inside the reviewed
73repository; these become repository-relative paths before scope and attribution
74checks, preserving a changed symlink's path when its target is also inside.
75Parent traversal and paths resolving outside the repository remain invalid.
76An invalid location still fails the report; findings are never silently dropped.
77 
78Local selection honors `core.autocrlf` from external operator Git configuration,
79with repository-local values and attributes retaining precedence. Only its
80validated scalar value reaches diff/status; other global and system Git
81configuration stays disabled. Repository-owned or relative global-config
82overrides are not imported, and reviewed source bytes are not rewritten.
83 
84Local collection disables effective Git clean/process commands and requires
85conversion to succeed. Unused drivers, unchanged filtered neighbors, staged-only
86changes, and deletions can still be reviewed without executing converters.
87If Git needs executable conversion to assemble the diff, collection fails before
88any reviewer starts. This can include an unchanged filtered file whose stat cache
89needs refreshing. Use explicit branch or commit mode for committed content in
90that case. Built-in line-ending normalization remains enabled; raw bytes never
91stand in for a required executable conversion.
92PR-base discovery uses trusted external Git and a scoped GitHub CLI environment,
93preserving external authentication/configuration and proxy settings while excluding
94inherited Git routing, `GH_REPO` redirection, and checkout-owned executables.
95A differently named `AUTOREVIEW_GIT` override that cannot also be selected as `git`
96by the child requires an explicit `--base`; rejected GitHub configuration paths
97also require one.
98 
99## Context and severity
100 
101Use `--prompt` for task-specific guidance, or `--prompt-file` and `--dataset` for
102repository-relative context files. Context does not expand the selected Git
103target. The reviewer cannot read unchanged repository files from its empty
104sandbox; supply relevant source or dependency evidence when the diff is insufficient.
105`--prompt-file` also accepts an absolute path inside the repository; the same
106sensitive-path, symlink, and mutation checks apply. `--dataset` stays repo-relative.
107Repeated paths in the same evidence role share one validated capture. Equal
108content at different paths and prompt-file versus dataset roles stay distinct.
109 
110For unchanged committed source, use repeatable `--source-context <repo-relative-path>`
111with branch or commit mode. Use `--source-context-file <repo-relative-path>` when
112that source must stay intact in every review pass. Both read the exact regular-file
113blob from the frozen reviewed commit (branch HEAD or `--commit`), including executable source files.
114Local mode, including an auto-selected local target, is unsupported. No separate
115context revision or working-copy substitution is accepted. The checkout path must
116remain a regular file; its bytes and path topology are revalidated throughout review.
117Repeated normalized source-context paths share one capture after every argument
118is validated; different paths and evidence roles remain distinct.
119 
120Both roles use tracked-source filename classification, so source names such as
121`src/token_count.py` are accepted. Credential directories, stores and keyfiles
122remain forbidden. Existing prompt-file and dataset restrictions are unchanged.
123Every source block carries path, commit, blob and mode provenance. `--source-context`
124bytes are partitioned with the change when needed. `--source-context-file` blocks
125stay complete in every pass and must fit with the instructions and change framing;
126the helper refuses an over-capacity plan without dropping required evidence.
127Context never adds finding targets or instruction authority. This is a
128source-provenance contract, not secret-content scanning.
129 
130```bash
131"$AUTOREVIEW" --mode branch --base origin/main --source-context src/token_count.py
132"$AUTOREVIEW" --mode branch --base origin/main --source-context-file src/token_count.py
133```
134 
135The default threshold is **P0 only**: material blockers to normal operation or
136safety. Use `--max-priority P1`, `P2`, or `P3` when the caller requests a wider
137review. `AUTOREVIEW_MAX_PRIORITY` accepts the same `P0`–`P3` values; an explicit
138flag overrides it. Invalid resolved priorities fail during argument parsing,
139before preparation or reviewer startup.
140Do not add unrelated redesign goals or prescribe file counts, reading
141sequences, or ritual extra passes. Historical blame requires a verified
142parent-relative patch; otherwise leave the attribution unknown.
143 
144```bash
145"$AUTOREVIEW" --mode local --prompt-file review-notes.md --dataset evidence.json
146```
147 
148## Engines
149 
150For automatic reviewer selection, try OpenAI models through Codex before Claude.
151Start with `--engine codex` even when the invoking agent uses Codex or asks for
152an independent second opinion. Use Claude only when the user explicitly selects
153it or Codex is unavailable for the review; report the concrete availability failure
154before switching. Do not switch because a review is slow, rate-limited, or returns
155findings, or to bypass a safety refusal or isolation failure.
156 
157Codex defaults to `gpt-6.1-sol`, high reasoning, with a single `gpt-6-sol` retry
158only for an account-access failure. Explicit `gpt-6.1-sol` selections use the same
159retry. Explicit `gpt-6-sol` selections retain their access-only `gpt-6-luna` retry;
160other explicit models, including Luna and Astra, have no model fallback.
161Explicit `gpt-5.6-sol` selections retain their access-only `gpt-5.6-terra` retry.
162GPT-6.1 Sol rejects `none` and `minimal` effort before review preparation;
163GPT-6 Sol and Luna reject `minimal`. An effort-only override keeps the default model.
164Honor explicit user engine/model choices.
165The helper does not automatically fall back between engines.
166 
167Use `--engine`, `--model`, and `--thinking` to override the defaults.
168`--codex-speed fast` selects priority service when supported. Only Claude accepts
169`--fallback-model`. Per-engine environment overrides use `AUTOREVIEW_<ENGINE>_*`.
170 
171If your account cannot access Sol or Luna, pin an available model. To require
172GPT-6 Astra without a model fallback, select it explicitly:
173 
174```bash
175"$AUTOREVIEW" --mode local --model gpt-6-astra --thinking high
176```
177 
178GPT-6.1 Sol and GPT-6 Astra support `low`, `medium`, `high`, `xhigh`, and `max`;
179neither supports `none` or `minimal`. GPT-6 Sol and Luna additionally support `none`,
180but not `minimal`. AutoReview defaults to
181`high` and does not fall back from an explicit Luna or Astra selection.
182Codex's `ultra` mode uses automatic
183delegation and is outside this helper's supported effort levels. Use `max`
184for its deepest supported review. For EU data residency, use
185`--codex-speed default`; GPT-6 fast mode is unavailable there.
186See the [GPT-6.1 Sol](https://developers.openai.com/api/docs/models/gpt-6.1-sol),
187[GPT-6 Sol](https://developers.openai.com/api/docs/models/gpt-6-sol), and
188[GPT-6 Luna](https://developers.openai.com/api/docs/models/gpt-6-luna) model docs
189and [Codex reasoning modes](https://learn.chatgpt.com/docs/models#know-when-to-use-max-or-ultra).
190 
191By default, Codex preserves only authentication settings from user configuration;
192provider, profile, context and catalogue settings remain ignored. To project a
193named route, select it explicitly through the existing config override:
194 
195```bash
196"$AUTOREVIEW" --mode local --codex-config 'model_provider="review_api"'
197```
198 
199The selector must match `model_provider` in the operator's external
200`CODEX_HOME/config.toml`. It accepts one bare or simply quoted identifier;
201provider definitions and other capabilities cannot be supplied through overrides.
202Projection requires Python 3.11 or `tomli`; default auth-only operation retains
203its existing fallback parser.
204 
205The selected route must use `https://api.openai.com/v1` and command authentication
206with an absolute external executable. Fixed arguments belong in that executable's
207wrapper; omitted or empty `auth.args` are accepted. Omitted `wire_api` and
208`requires_openai_auth` retain Codex's `responses` and `false` defaults. Optional
209auth timing and context settings keep native defaults and semantics.
210 
211On POSIX, a private launcher restores the validated caller `HOME` only for the
212selected authentication executable; the engine and reviewer tools retain their
213isolated environment and filesystem access. Caller `HOME` must be an available
214absolute directory with no repository-owned path or symlink provenance. Windows
215keeps the native executable route. Command-auth runs suppress raw provider
216diagnostics and report fixed failure categories, while retaining compact progress,
217usage and assistant report streaming. An empty final report fails without exposing
218captured stdout.
219 
220Catalogue and authentication working-directory paths resolve relative to the
221operator config directory and must remain outside the reviewed repository.
222A supplied catalogue is copied byte-for-byte into the private client runtime;
223retries use the same route and catalogue snapshot. Dry runs check the same
224ownership and route shape without executing authentication. Codex owns catalogue
225validation, model access and context clamping. Other custom provider forms and
226split context overrides are unsupported when projection is selected.
227 
228| Optional engine | Prerequisites |
229| --------------- | ----------------------------------------------------------------------------------------------------- |
230| Claude | CLI 2.1.169+; safe mode with web-only tools |
231| Amp | `AMP_API_KEY` for a plugin-free account; local POSIX execution, no custom endpoint or cloud/orb agent |
232| Pi | CLI 0.79.0+; configured model; no tools or project resources |
233 
234`--engine kimi` remains recognized but is refused for reviews and `--dry-run`
235before any Kimi process, configuration read or authentication setup. The supported
236Kimi Code prompt mode accepts review content only as a command-line argument;
237the helper has no supported private prompt input channel for it. This intentionally
238retires the previous Kimi execution path rather than exposing the bundle in process
239arguments. Existing `--kimi-bin` arguments remain accepted for the same clear refusal;
240the helper never silently selects another engine. A custom agent file is not an
241equivalent replacement because it changes the input into a templated system prompt.
242 
243## Image review
244 
245Branch mode with Codex supports **added, single-frame PNG, JPEG and WebP** files.
246Install Pillow in the Python environment running the helper (`python -m pip install Pillow`).
247Use a vision-capable Codex model and a CLI supporting `codex exec --image`.
248No new bypass flag is required. Full decoding rejects corrupt and animated files.
249Images must have at most 16,777,216 pixels and no dimension above 16,384 pixels;
250decoder bomb warnings fail closed before pixel loading. Added image paths are
251limited to 20 MiB of encoded bytes each and 100 MiB total, checked against Git
252object sizes before capture. Exceeding a limit fails the entire review.
253 
254The helper captures exact bytes from the pinned HEAD, stages only those images
255in its isolated workspace, and attaches them through Codex's native image input.
256Every pass receives the path, media type, byte count and SHA-256 manifest alongside
257the image attachments and text diff. Image findings use the original path and line 1.
258Text-only review does not require Pillow.
259 
260Binary deletions, including images, are reviewed as deletion metadata in every
261mode without image attachments or Pillow. Other binaries, modified images,
262local/commit image additions or modifications, and image review with other engines
263remain unsupported and fail closed. Missing Pillow or provider
264image limits fail the review rather than silently dropping assets. Sensitive-path,
265source-mutation, authentication and sandbox controls remain enabled.
266 
267For partial clones, materialize required Git objects **before** review. The isolated
268Git reader intentionally disables lazy network fetching; do not weaken that boundary.
269 
270## Runtime boundaries
271 
272The helper owns reviewer isolation, sanitized authentication, process cleanup,
273Git scope, and structured result validation. Keep those controls enabled.
274Before repository detection or target selection, Git must pass `--version`
275within 10 seconds. Failure exits `2` with an `incomplete` diagnostic and the
276resolved executable (or the unresolved selection); it never means `scoped-clean`.
277Set `AUTOREVIEW_GIT` to a trusted external Git executable to override every
278helper-owned Git invocation. On macOS with a broken selected Xcode, use
279`DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer` for the invocation.
280Only an absolute, external `DEVELOPER_DIR` is additionally retained in Git's
281sanitized environment;
282neither override is forwarded to the isolated reviewer environment.
283 
284Every reviewer pass must inspect its bundle for real credentials and report
285suspected credentials as P0 findings without reproducing their values. Harmless
286placeholders and test fixtures are not credentials. Autoreview does not require
287or invoke an external secret scanner. Never work around an isolation failure.
288 
289### Intentional scanner-free policy
290 
291Keep approved secret scanning outside autoreview; reviewer findings happen after
292transmission. Reintroducing a scanner requires an explicit maintainer decision.
293See [#240](https://github.com/openclaw/agent-skills/pull/240) for rationale and history.
294 
295### Reviewer isolation
296 
297On macOS, reviewer tools cannot access the shared `/tmp` and `/var/tmp` trees
298(including their `/private` aliases). Codex preflight rejects those temporary
299roots before workspace, runtime, or authentication setup; unset a shared
300`TMPDIR`/`TMP`/`TEMP` override to use macOS's private
301temporary directory. Other engines and platforms retain their normal isolation.
302Tools installed in shared scratch or requiring writes there will be denied too.
303 
304Text review files have no size/count cap and are never truncated; image inputs
305use the explicit safety limits above. Large diffs and
306datasets are partitioned automatically. Change partitions retain complete
307datasets when they fit with sufficient change space. This preference may use more
308passes or prompt bytes than evidence batching; the explicit pass budget still applies.
309Terminal fallbacks preserve a feasible complete-evidence plan when batch framing cannot fit.
310Intact instructions, source-context files and required mixed source context must
311fit the per-pass prompt budget. A failed pass does not produce a partial clean verdict.
312Otherwise, the planner compares a bounded set of evidence allocations and keeps the existing
313plan unless total prompt bytes improve without more passes, or equal bytes need
314fewer passes. Every change is still reviewed against every evidence batch.
315 
316Each pass is an independent assignment, not a continuing conversation. Its
317private completion field must confirm a finished assessment; deferring to
318another pass leaves the overall review incomplete.
319 
320Do not edit inputs during a review: the helper verifies captured sources before
321sending and publishing results. Long reviews are normal; advancing heartbeats
322mean progress. Use `--stream-engine-output` for visibility, not extra reviewer
323runs. `--dry-run` checks preparation and startup without contacting a reviewer.
324Both dry runs and execution print planned pass count and total prompt bytes.
325Use `--max-review-passes N` (or `AUTOREVIEW_MAX_REVIEW_PASSES`) to reject the whole
326plan before any reviewer starts when it exceeds an explicit campaign budget.
327There is no default pass ceiling. `--engine-timeout-seconds` remains an optional
328deadline per process attempt. Pass counts, prompt bytes, and deadlines are not
329token hard caps; they do not bound model reasoning or tool use.
330 
331## Diagnostics and results
332 
333Follow the [diagnostic and result guidance](references/diagnostics-and-results.md)
334for local stage observation, output paths, exit codes, status, and usage.
335 

Discussion