fix(OpenCode 呼叫): 降低並行請求並重試暫時性錯誤
CI / AI Code Review (pull_request) Failing after 3s

This commit is contained in:
2026-06-26 09:36:33 +00:00
parent 6c3e7b9d37
commit 93be261b90
3 changed files with 56 additions and 7 deletions
+6 -5
View File
@@ -120,15 +120,16 @@ async function main() {
} catch (e) {
warn(`角色介紹 comment 發布失敗(繼續執行): ${e.message}`);
}
const analyses = await Promise.allSettled(roles.map(role => analyzeWithRole(role, diff)));
const newFindings = [];
let fulfilledAnalyses = 0;
for (let i = 0; i < analyses.length; i++) {
if (analyses[i].status === 'fulfilled') {
for (const role of roles) {
try {
const findings = await analyzeWithRole(role, diff);
fulfilledAnalyses += 1;
newFindings.push(...analyses[i].value);
newFindings.push(...findings);
} catch (e) {
warn(`[${role.name}] 分析失敗(跳過): ${e.message}`);
}
else warn(`[${roles[i].name}] 分析失敗(跳過): ${analyses[i].reason?.message}`);
}
if (fulfilledAnalyses === 0) {
result(false, '所有角色分析皆失敗,終止流程以避免誤判為審查通過');