From 2618fa9168676e6d5e48b535f3961a3aea1c4c29 Mon Sep 17 00:00:00 2001 From: Xingbo Wang Date: Sat, 28 Mar 2026 07:42:35 -0700 Subject: [PATCH 1/2] ci: increase Claude review timeout from 10 to 60 minutes The claude-code-base-action defaults to timeout_minutes=10, which is insufficient for large PRs. The review of PR #14499 timed out after 600 seconds (exit code 124) while Claude was mid-review. Set timeout_minutes=60 for both auto-review and manual-review jobs. --- .github/workflows/claude-review.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 9fae483cf30..2e2c653c03c 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -185,6 +185,7 @@ jobs: prompt_file: /tmp/prompt.txt model: claude-opus-4-6 max_turns: "300" + timeout_minutes: "60" allowed_tools: "View,GlobTool,GrepTool,Write,Task" anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} @@ -449,6 +450,7 @@ jobs: prompt_file: /tmp/prompt.txt model: ${{ github.event_name == 'workflow_dispatch' && inputs.model || 'claude-opus-4-6' }} max_turns: "300" + timeout_minutes: "60" allowed_tools: "View,GlobTool,GrepTool,Write,Task" anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} From 020ff0f8c06b6192a3ed3deef26e04bf095e7e4b Mon Sep 17 00:00:00 2001 From: Xingbo Wang Date: Sat, 28 Mar 2026 08:03:32 -0700 Subject: [PATCH 2/2] ci: retry PR lookup when workflow_run races with PR creation Exported PRs (e.g. from Meta's internal export pipeline) can trigger CI within milliseconds of PR creation. When this happens, the workflow_run payload has pull_requests=[], and the SHA-based fallback lookup also misses because the PR isn't registered yet. Fix by retrying the SHA lookup up to 5 times with a 10s delay, giving GitHub up to ~50 seconds to associate the PR. Also increase per_page from 30 to 100 to reduce the chance of missing the PR in busy repos. --- .github/workflows/claude-review.yml | 33 +++++++++++++++++++---------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 2e2c653c03c..8260f20d21b 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -71,20 +71,31 @@ jobs: if (prs && prs.length > 0) { prNumber = prs[0].number; } else { - const { data: pulls } = await github.rest.pulls.list({ - owner: context.repo.owner, - repo: context.repo.repo, - state: 'open', - sort: 'updated', - direction: 'desc', - per_page: 30 - }); - const match = pulls.find(p => p.head.sha === headSha); - if (match) prNumber = match.number; + // PR may not be registered yet if push and PR creation raced. + // Retry up to 5 times with 10s delay. + for (let attempt = 0; attempt < 5; attempt++) { + if (attempt > 0) { + core.info(`PR not found for SHA ${headSha}, retrying in 10s (attempt ${attempt + 1}/5)...`); + await new Promise(r => setTimeout(r, 10000)); + } + const { data: pulls } = await github.rest.pulls.list({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + sort: 'updated', + direction: 'desc', + per_page: 100 + }); + const match = pulls.find(p => p.head.sha === headSha); + if (match) { + prNumber = match.number; + break; + } + } } if (!prNumber) { - core.setFailed(`Could not find PR for SHA ${headSha}`); + core.setFailed(`Could not find PR for SHA ${headSha} after retries`); return; }