Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/ci/run_opencode_review_model_pool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ record_review_model() {
normalize_opencode_output() {
local output_file="$1"

# Strip terminal escape sequences in place first, so the pool validates the
# exact bytes the publish step re-validates (it ANSI-strips with the same
# regex before running the normalizer). Without this the pool could accept a
# model whose raw output passes but whose ANSI-stripped form the publish step
# rejects, ending the run in failure instead of falling through to the next
# model in the pool.
local stripped
stripped="$(mktemp)"
if perl -pe 's/\x1b\[[0-9;?]*[A-Za-z]//g' "$output_file" >"$stripped" 2>/dev/null; then
mv "$stripped" "$output_file"
else
rm -f "$stripped"
fi

if python3 "$GITHUB_WORKSPACE/scripts/ci/opencode_review_normalize_output.py" \
"$HEAD_SHA" "$RUN_ID" "$RUN_ATTEMPT" "$output_file"; then
bash "$GITHUB_WORKSPACE/scripts/ci/opencode_review_approve_gate.sh" \
Expand Down
Loading