Skip to content

Commit e96f864

Browse files
committed
Merge PolyArch/dev into Horacehxw/dev to resolve conflicts
# Conflicts: # hooks/loop-codex-stop-hook.sh # tests/test-disable-nested-codex-hooks.sh # tests/test-finalize-phase.sh
2 parents 5977a4d + 8986bf3 commit e96f864

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

hooks/loop-codex-stop-hook.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,8 @@ run_codex_code_review() {
12381238
local prompt_fallback="# Code Review Phase - Round ${round}
12391239
12401240
This file documents the code review invocation for audit purposes.
1241+
Compatibility note: Codex 0.130.0 rejects [PROMPT] input, including - stdin, when --base is used.
1242+
Humanize must not pass prompt input when --base is used; this file is audit-only.
12411243
Provider: codex
12421244
12431245
## Review Configuration

prompt-template/codex/code-review-phase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Code Review Phase - Round {{REVIEW_ROUND}}
22

33
This file documents the code review invocation for audit purposes.
4-
Note: `codex review` does not accept prompt input; it performs automated code review based on git diff.
4+
Compatibility note: Codex 0.130.0 rejects `[PROMPT]` input, including `-` stdin, when `--base` is used. Humanize must not pass prompt input when `--base` is used; this file is audit-only.
55

66
## Review Configuration
77

tests/test-disable-nested-codex-hooks.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,24 @@ if [[ "\$subcommand" == "exec" ]]; then
9999
fi
100100
101101
if [[ "\$subcommand" == "review" ]]; then
102+
saw_base=false
103+
saw_prompt=false
104+
for arg in "\$@"; do
105+
if [[ "\$arg" == "--base" ]]; then
106+
saw_base=true
107+
elif [[ "\$arg" == "-" ]]; then
108+
saw_prompt=true
109+
fi
110+
done
111+
if [[ "\$saw_base" == "true" && "\$saw_prompt" == "true" ]]; then
112+
echo "codex 0.130.0 rejects --base with prompt input" >&2
113+
exit 64
114+
fi
115+
if IFS= read -r stdin_line || [[ -n "\$stdin_line" ]]; then
116+
printf 'STDIN:%s\n' "\$stdin_line" >> "$args_file"
117+
echo "codex review must not receive stdin when --base is used" >&2
118+
exit 65
119+
fi
102120
echo "No issues found."
103121
exit 0
104122
fi
@@ -214,6 +232,24 @@ else
214232
"pipeline still present"
215233
fi
216234

235+
if grep -q -- ' --base ' "$TEST_DIR/review.args" && ! grep -q -- ' -$' "$TEST_DIR/review.args" && ! grep -q '^STDIN:' "$TEST_DIR/review.args"; then
236+
pass "review-phase codex review uses --base without prompt input"
237+
else
238+
fail "review-phase codex review avoids --base plus prompt input" \
239+
"--base arguments with no trailing '-' and no stdin" "$(cat "$TEST_DIR/review.args" 2>/dev/null || echo missing)"
240+
fi
241+
242+
REVIEW_PROMPT=""
243+
if [[ -d "$REPO_REVIEW/.humanize/rlcr" ]]; then
244+
REVIEW_PROMPT=$(find "$REPO_REVIEW/.humanize/rlcr" -mindepth 2 -maxdepth 2 -type f -name 'round-*-review-prompt.md' -print | sort | tail -n 1)
245+
fi
246+
if [[ -f "$REVIEW_PROMPT" ]] && grep -q -- 'must not pass prompt input when `--base` is used' "$REVIEW_PROMPT"; then
247+
pass "review audit prompt documents --base prompt incompatibility"
248+
else
249+
fail "review audit prompt documents --base prompt incompatibility" \
250+
'must not pass prompt input when `--base` is used' "$(cat "$REVIEW_PROMPT" 2>/dev/null || echo missing)"
251+
fi
252+
217253
echo ""
218254
echo "========================================"
219255
echo "Disable Nested Codex Hooks Tests"

0 commit comments

Comments
 (0)