



















@@ -24,6 +24,7 @@ Options:
2424 --no-yolo Run nested Codex review with normal sandbox/approval prompts.
2525 --output FILE Also save output to file.
2626 --parallel-tests CMD Run review and test command concurrently.
27+ Default: pnpm --config.offline=true run check when available.
2728 --dry-run Print selected commands, do not run.
2829 -h, --help Show help.
2930@@ -54,6 +55,7 @@ codex_args=()
5455yolo=${AUTOREVIEW_YOLO:-${CODEX_REVIEW_YOLO:-1}}
5556output=${AUTOREVIEW_OUTPUT:-${CODEX_REVIEW_OUTPUT:-}}
5657parallel_tests=
58+parallel_tests_auto=false
5759dry_run=false
5860codex_review_prompt=
5961openclaw_maintainer_validation=${AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION:-${OPENCLAW_TESTBOX:-0}}
@@ -166,6 +168,12 @@ esac
166168167169repo_root=$(git rev-parse --show-toplevel)
168170171+has_package_check_script() {
172+command -v node >/dev/null 2>&1 || return 1
173+ node -e 'const p = require("./package.json"); process.exit(p.scripts?.check ? 0 : 1)' \
174+>/dev/null 2>&1
175+}
176+169177current_branch=$(git branch --show-current 2>/dev/null || true)
170178dirty=false
171179if [[ -n "$(git status --porcelain)" ]]; then
@@ -212,6 +220,15 @@ case "$openclaw_maintainer_validation" in
212220 1|true|True|TRUE|yes|Yes|YES|on|On|ON) openclaw_maintainer_validation=1 ;;
213221*) openclaw_maintainer_validation=0 ;;
214222esac
223+if [[ -z "$parallel_tests" && "$openclaw_maintainer_validation" != 1 ]] &&
224+ [[ "${AUTOREVIEW_AUTO_TESTS:-${CODEX_REVIEW_AUTO_TESTS:-1}}" != 0 ]]; then
225+if [[ -f package.json && -f pnpm-lock.yaml && -d node_modules ]] &&
226+command -v pnpm >/dev/null 2>&1 &&
227+ has_package_check_script; then
228+ parallel_tests="pnpm --config.offline=true run check"
229+ parallel_tests_auto=true
230+fi
231+fi
215232if [[ "$repo_url" == *"openclaw/openclaw"* && "$openclaw_maintainer_validation" == 1 ]]; then
216233 codex_review_prompt=$(cat <<'EOF'
217234OpenClaw maintainer autoreview validation policy:
@@ -251,7 +268,11 @@ else
251268printf 'review: %s prompt review\n' "$reviewer"
252269fi
253270if [[ -n "$parallel_tests" ]]; then
254-printf 'tests: %s\n' "$parallel_tests"
271+printf 'tests: %s' "$parallel_tests"
272+if [[ "$parallel_tests_auto" == true ]]; then
273+printf ' (auto)'
274+fi
275+printf '\n'
255276fi
256277if [[ "$review_kind" == branch ]]; then
257278printf 'fetch: git fetch origin --quiet\n'
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。