

























@@ -51,6 +51,7 @@ yolo=${AUTOREVIEW_YOLO:-${CODEX_REVIEW_YOLO:-1}}
5151output=${AUTOREVIEW_OUTPUT:-${CODEX_REVIEW_OUTPUT:-}}
5252parallel_tests=
5353dry_run=false
54+codex_review_prompt=
54555556while [[ $# -gt 0 ]]; do
5657case "$1" in
@@ -201,6 +202,19 @@ else
201202 review_cmd=("$codex_bin" "${codex_args[@]}" review --base "$base_ref")
202203fi
203204205+repo_url=$(git -C "$repo_root" config --get remote.origin.url 2>/dev/null || true)
206+if [[ "$repo_url" == *"openclaw/openclaw"* ]]; then
207+ codex_review_prompt=$(cat <<'EOF'
208+OpenClaw autoreview validation policy:
209+- Review the diff by reading code, tests, and dependency contracts.
210+- Do not run local memory-heavy Node validation from review mode. This includes local pnpm checks/tests, Vitest, tsgo, npm test, and node scripts/run-vitest.mjs.
211+- If runtime proof is needed, use existing proof or route validation through OPENCLAW_TESTBOX=1 / Crabbox / Blacksmith Testbox and report the exact provider and id.
212+- If remote validation is not necessary for the finding, state the targeted proof that should be run instead of starting local tests.
213+EOF
214+)
215+ review_cmd+=(-)
216+fi
217+204218printf 'autoreview target: %s\n' "$review_kind"
205219printf 'branch: %s\n' "${current_branch:-detached}"
206220if [[ -n "$pr_url" ]]; then
@@ -221,6 +235,9 @@ if [[ "$reviewer" == auto || "$reviewer" == codex ]]; then
221235printf 'review:'
222236printf ' %q' "${review_cmd[@]}"
223237printf '\n'
238+if [[ -n "$codex_review_prompt" ]]; then
239+printf 'review policy: OpenClaw Crabbox/Testbox-aware validation prompt injected\n'
240+fi
224241else
225242printf 'review: %s prompt review\n' "$reviewer"
226243fi
@@ -265,7 +282,11 @@ trap cleanup EXIT
265282266283run_review() {
267284 mkdir -p "$(dirname "$review_output")"
268-"${review_cmd[@]}" 2>&1 | tee "$review_output"
285+if [[ -n "$codex_review_prompt" ]]; then
286+printf '%s\n' "$codex_review_prompt" | "${review_cmd[@]}" 2>&1 | tee "$review_output"
287+else
288+"${review_cmd[@]}" 2>&1 | tee "$review_output"
289+fi
269290}
270291271292diff_for_review() {
@@ -306,6 +327,7 @@ Rules:
306327- Review the proposed code change as a closeout reviewer.
307328- Focus on the diff below. If your CLI exposes read-only repository tools, inspect surrounding code and tests to verify findings; never modify files.
308329- Do not modify files.
330+- In OpenClaw, do not run local memory-heavy Node validation from review mode. Avoid local pnpm checks/tests, Vitest, tsgo, npm test, and node scripts/run-vitest.mjs. If runtime proof is needed, use existing proof or route validation through OPENCLAW_TESTBOX=1 / Crabbox / Blacksmith Testbox and report the exact provider and id.
309331- Report only discrete, actionable issues introduced by this change.
310332- Prioritize correctness, regressions, security, data loss, performance cliffs, and missing tests that would catch a real bug.
311333- Do not report pre-existing issues, speculative risks, broad rewrites, style nits, changelog gaps, or findings that depend on unstated assumptions.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。