Skip to content

Commit 36b6bba

Browse files
authored
Merge branch 'main' into fix/tui-plugin-command-autocomplete
2 parents 02ec66a + 27c7e1e commit 36b6bba

1,398 files changed

Lines changed: 34932 additions & 8459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/autoreview/SKILL.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ description: "Autoreview closeout: local dirty changes, PR branch vs main, paral
77

88
Run Codex's built-in code review as a closeout check. This is code review (`codex review`), not Guardian `auto_review` approval routing.
99

10+
Codex native review mode performs best and is recommended. Non-Codex reviewers are fallback/second-opinion paths that receive a generated diff prompt, not the full Codex review-mode runtime.
11+
1012
Use when:
1113
- user asks for Codex review / autoreview / second-model review
1214
- after non-trivial code edits, before final/commit/ship
@@ -21,11 +23,12 @@ Use when:
2123
- Prefer small fixes at the right ownership boundary; no refactor unless it clearly improves the bug class.
2224
- Keep going until the selected review path returns no accepted/actionable findings.
2325
- If a review-triggered fix changes code, rerun focused tests and rerun the review helper.
24-
- Default to Codex review. If Codex is unavailable or exits with an error, the helper may fall back to `claude -p`; `pi -p` and `opencode run` are explicit reviewer/fallback options. The helper runs nested Codex review in yolo/full-access mode by default; use `--no-yolo` only when intentionally testing sandbox behavior.
26+
- Default to Codex review. If Codex is unavailable or exits with an error, the helper falls back to the first configured CLI from `claude -p`, `pi -p`, `opencode run`, `droid exec`, or `copilot`. Prefer Codex for final closeout because it uses native review mode; non-Codex reviewers use a Codex-inspired generated diff prompt. The helper runs nested Codex review in yolo/full-access mode by default; use `--no-yolo` only when intentionally testing sandbox behavior.
2527
- Stop as soon as the review command/helper exits 0 with no accepted/actionable findings. Do not run an extra direct `codex review` just to get a nicer "clean" line, a second opinion, or clearer closeout wording.
2628
- Treat the helper's successful exit plus absence of actionable findings as the clean review result, even if the underlying Codex CLI output is terse.
2729
- If rejecting a finding as intentional/not worth fixing, add a brief inline code comment only when it explains a real invariant or ownership decision that future reviewers should know.
2830
- Do not push just to review. Push only when the user requested push/ship/PR update.
31+
- For OpenClaw maintainers, keep autoreview validation Crabbox/Testbox-aware when maintainer validation mode is enabled (`OPENCLAW_TESTBOX=1` or `AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION=1`). A review pass may inspect files and run cheap non-Node probes, but it must not start local `pnpm`, Vitest, `tsgo`, `npm test`, or `node scripts/run-vitest.mjs` from a Codex/worktree review unless the operator explicitly requested local proof. For runtime proof, use existing evidence or route through Crabbox/Testbox and report the id. Do not apply this rule to ordinary contributors who do not have maintainer Testbox access.
2932

3033
## Pick Target
3134

@@ -48,7 +51,11 @@ git fetch origin
4851
codex review --base origin/main
4952
```
5053

51-
Do not pass an inline prompt with `--base`; current CLI rejects `--base` + `[PROMPT]` even though help text is ambiguous. If custom instructions are needed, run the plain base review first, then do a local/manual follow-up pass.
54+
Do not pass any prompt with `--base`. Some Codex CLI versions reject both inline
55+
and stdin prompt forms, including the helper's `codex review --base <ref> -`,
56+
with `--base <BRANCH> cannot be used with [PROMPT]`. If the helper hits this
57+
error, run plain `codex review --base <ref>` and report that the helper prompt
58+
injection was skipped.
5259

5360
If an open PR exists, use its actual base:
5461

@@ -105,14 +112,17 @@ The helper:
105112
- chooses dirty `--uncommitted` first
106113
- otherwise uses current PR base if `gh pr view` works
107114
- otherwise uses `origin/main` for non-main branches
115+
- auto-runs `PNPM_CONFIG_PM_ON_FAIL=ignore PNPM_CONFIG_VERIFY_DEPS_BEFORE_RUN=false PNPM_CONFIG_OFFLINE=true pnpm run check` in parallel when a repo has `package.json`, `pnpm-lock.yaml`, `node_modules`, and a `check` script; disable with `AUTOREVIEW_AUTO_TESTS=0`
108116
- use `--mode commit --commit <ref>` for already-committed work, especially clean `main` after landing
109117
- should be left in `--mode auto` or forced to `--mode branch` for PR/branch work; do not force `--mode local` after committing
110-
- supports `--reviewer codex|claude|pi|opencode|auto`; `auto` runs Codex first
111-
- supports `--fallback-reviewer claude|pi|opencode|none`; default is `claude`
118+
- supports `--reviewer codex|claude|pi|opencode|droid|copilot|auto`; `auto` means Codex first
119+
- supports `--fallback-reviewer auto|claude|pi|opencode|droid|copilot|none`; default is configured CLI fallback
112120
- falls back only when Codex is unavailable or exits nonzero, not when Codex reports findings
113121
- writes only to stdout unless `--output` or `AUTOREVIEW_OUTPUT` is set
114122
- supports `--dry-run`, `--parallel-tests`, and commit refs
115123
- runs nested review with `--dangerously-bypass-approvals-and-sandbox --sandbox danger-full-access` by default
124+
- injects maintainer-only OpenClaw validation policy into native Codex review when `OPENCLAW_TESTBOX=1` or `AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION=1`, so local memory-heavy Node/Vitest checks are avoided in favor of Crabbox/Testbox proof
125+
- branch mode may fail on Codex CLI versions that reject `--base` plus the helper's stdin prompt; on that exact parser error, rerun plain `codex review --base <ref>` instead of falling back to a non-Codex reviewer
116126
- keeps accepting `--full-access`; use `--no-yolo` or `AUTOREVIEW_YOLO=0` to opt out
117127
- still accepts legacy `CODEX_REVIEW_*` env vars when the matching `AUTOREVIEW_*` var is unset
118128
- prints `autoreview clean: no accepted/actionable findings reported` when the selected review command exits 0
@@ -126,3 +136,10 @@ Include:
126136
- the clean review result from the final helper/review run, or why a remaining finding was consciously rejected
127137

128138
Do not run another Codex review solely to improve the final report wording. If the final helper run exited 0 and produced no accepted/actionable findings, report that exact run as clean.
139+
140+
## PR / CI Closeout
141+
142+
- Prefer direct run/job APIs after CI starts: `gh run view <run-id> --json jobs`; use PR rollup only for final mergeability.
143+
- After rebase, compare `origin/main..HEAD`; drop CI-fix commits already upstream before pushing.
144+
- For prompt snapshot CI failures, prove/generate with Linux Node 24 before rerunning the failed job.
145+
- Update PR body once near the final head unless proof labels are missing or stale enough to block CI.

0 commit comments

Comments
 (0)