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 ScratchV-Compiler#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).
概述
修复
ai-code-review.ymlAI Code Review workflow 在大 PR 上因模型超时导致 job 失败(exit code 28)的问题。背景
PR #35 的 CI 在 "AI Code Review" step 失败:
根因(本地用真实 PR 数据完整复现确认):
deepseek-v4-flash在此 key 下处理大文件 diff(如 ci.yml ~14KB payload)时持续挂起,超过 curl 的 60s 超时。--retry-all-errors又把 HTTP 429(配额)当成可重试错误,重试 3 次,把一次超时拖成 180s+ 的挂起,最终 curl 返回exit 28。bash -e -o pipefail使任何非零退出立即中止整个 step → job 标红。对照实验(同 key、同 PR #35 真实 diff、workflow 原样 curl 参数,仅换模型):
deepseek-v4-flashglm-5.2Workspace allocated quota exceeded(key 无该模型额度)❌sensenova-6.8-flash-lite改动内容
deepseek-v4-flash→sensenova-6.8-flash-lite(唯一实测稳定通过的模型)。--retry-all-errors:HTTP 429(配额)不再被重试成长时间挂起。|| { echo "[WARN] ..."; continue; }包裹——单文件超时被当作"本次无结果"跳过,job 仍正常成功,不再因set -e崩溃。--max-time 60 --retry 3→--max-time 30 --retry 1,单个慢文件最多占用 ~60s(原 ~240s),确保 job 落在timeout-minutes: 15内。验证
本地端到端:以
sensenova-6.8-flash-lite跑完整 21 文件 PR #35 模拟,全部文件成功返回 review,无 exit 28 / 429 崩溃。bash -n语法检查通过,YAML 校验通过。备注
[WARN] curl timeout ... skipped (no result)并跳过该文件,job 保持绿色成功。glm-5.2已验证此 key 无额度(Workspace allocated quota exceeded),故未采用。