From 41a112fef9ff04fed02f056027a9065bb6a2d429 Mon Sep 17 00:00:00 2001 From: watneyzhu <1253349077@qq.com> Date: Tue, 25 Aug 2026 22:18:35 +0800 Subject: [PATCH] fix(ci): switch AI review model and make per-file curl failure non-fatal The AI code review workflow failed (exit 28) on large PRs because deepseek-v4-flash processing a big file diff (e.g. ci.yml ~14KB payload) hangs past the curl timeout, and --retry-all-errors then retried the subsequent HTTP 429 quota errors into a 180s+ hang + curl exit 28, which the implicit set -e (GitHub Actions default bash) turned into a job failure. Local repro on real PR #35 data (same key and workflow curl args, model swapped): - deepseek-v4-flash: first file times out (exit 28), job aborts - glm-5.2: 429 Workspace allocated quota exceeded (key has no quota) - sensenova-6.8-flash-lite: all files return 200, stable Changes: - Switch model to sensenova-6.8-flash-lite (verified working). - Drop --retry-all-errors so HTTP 429 (quota) is not retried into a hang. - Wrap curl in || { [WARN] ...; continue; } so a per-file curl failure is treated as 'no result' and skipped while the job still succeeds, instead of aborting via set -e. - Set --max-time 90 --retry 0: gives large diffs enough time while capping worst case at 90s/file (10 files fit inside timeout-minutes: 15). --- .github/workflows/ai-code-review.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ai-code-review.yml b/.github/workflows/ai-code-review.yml index 5391af2..273174d 100644 --- a/.github/workflows/ai-code-review.yml +++ b/.github/workflows/ai-code-review.yml @@ -83,7 +83,7 @@ jobs: # ── Escape for JSON ── # Use jq to build the payload safely PAYLOAD=$(jq -n \ - --arg model "deepseek-v4-flash" \ + --arg model "sensenova-6.8-flash-lite" \ --arg system "$SYSTEM_PROMPT" \ --arg user "$USER_MSG" \ '{ @@ -99,11 +99,11 @@ jobs: if [ "${FILE_COUNT:-0}" -gt 0 ]; then sleep 1 # rate-limit: 1s gap between files fi - RESPONSE=$(curl -s --max-time 60 --retry 3 --retry-all-errors -w "\n%{http_code}" \ + RESPONSE=$(curl -s --max-time 90 --retry 0 -w "\n%{http_code}" \ "https://token.sensenova.cn/v1/chat/completions" \ -H "Authorization: Bearer $SENSENOVA_API_KEY" \ -H "Content-Type: application/json" \ - -d "$PAYLOAD") + -d "$PAYLOAD") || { echo " [WARN] curl failed for $FILE (exit $?) — skipped (no result)"; continue; } HTTP_CODE=$(echo "$RESPONSE" | tail -1) BODY=$(echo "$RESPONSE" | sed '$d')