Repository navigation
feat(review): retry review lanes once on a fallback token and fix lane drift - #756
Conversation
…e drift - Optional `fallback-claude-code-oauth-token` secret on pr-review.yml and pr-review-security.yml: a first attempt that stops on a usage limit (class rate-limit) is retried once in the same job, inside the review step's budget, before the report steps; the completion record ends `account=fallback`. Without the secret the job behaves as before. - `model` and `effort` inputs (default `sonnet`, `high` on both lanes) appended as --model/--effort after claude-args; the legacy `--model claude-sonnet-5` default is gone. - classify_inline_comments: false, include_fix_links: false and CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on the review steps. - A rebase or restack that leaves every file's status and patch as reviewed, with no base change under the pull request's files, is a no-change skip (claude-code-plugins#7669). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The reviewed-head marker records the base branch and merge base on its second line. A rebase skips only on the same base branch, when the change reviewed from that merge base touches the same files the same way, and `git diff --raw` shows those paths identical (mode, type, blob) between the reviewed head and this one. - No skip (no-change or docs-only) while the live pull request head differs from the run's head. - The first attempt's usage limit is detected inline by the classify.cjs rule (a test pins parity) and leaves a warning with no class= token, so only the final report names the run's class. - The pick step carries the chosen attempt's structured output through a random heredoc delimiter; an empty fallback output no longer borrows the first attempt's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 6m 15s —— View job Claude code review in progress
|
|
Claude finished @kyle-sexton's task in 3m 46s —— View job Security review in progress
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ebf8fc393
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
claude-security-review has reviewed this pull request through d4d5617; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through d4d5617; a later push is reviewed from there. |
…omments A first attempt that called the inline-comment tool before its usage limit is no longer retried on the fallback token, so no finding posts twice and verification never counts only the retry's comments. The check step keeps its rate-limit output equal to classify.cjs and adds a retry output that the fallback gates on, in both review lanes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
|
Claude finished @kyle-sexton's task in 1m 37s —— View job Security review in progress
|
|
Claude finished @kyle-sexton's task in 3m 0s —— View job Claude code review: no blocking findingsScope (incremental): reviewed only what changed since
What this increment doesCommit Verification
One intentional tradeoff worth noting but not a blocker: No inline comments to post — I didn't find anything a careful reviewer would block on in this increment. |
…de (#760) No related issue: org-wide outage fix; every AI review lane run since about 18:39Z 2026-10-17 fails while installing Claude Code. ## Summary #756 set `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1"` on both review attempts in `pr-review.yml` and `pr-review-security.yml`. Claude Code 2.1.300 (the version claude-code-action v1.0.250 installs) refuses to start on Linux with the scrub on and no bubblewrap: ``` error: bubblewrap is required for subprocess env scrubbing and isolation. Install with: sudo apt-get install -y bubblewrap, set sandbox.bwrapPath in managed settings, or set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=0 to disable (loses subprocess isolation). ``` (claude-code-plugins run 39059470151.) The action's own "Install subprocess isolation dependencies" step runs only when `allowed_non_write_users` is set, which the review lanes do not set, so nothing installed bwrap. `intake-triage.yml` sets `allowed_non_write_users: "*"`, so the action installs it there and that lane is unaffected. ## Fix Add an "Install subprocess isolation" step before the first review attempt in both workflows: apt-get install `bubblewrap` and `socat` with three retries, lift the Ubuntu 24.04 AppArmor userns restriction, and fail closed when `bwrap` is missing. This matches the action's step and claude-code-plugins' `setup-runner-isolation` action. The scrub stays on. The fallback attempt runs in the same job, so one install covers both. ## Verification - `actionlint` over both files: no new findings. The `$/.github/actions/report-lane-outcome` finding was already on `main`. - `node --test .github/scripts/*.test.cjs`: 420 passed, 0 failed. - This PR's own review lanes run the patched copy only after merge; the check that matters is the first caller run after the repin. ## Related - #756 (introduced the scrub env) - Upstream: https://code.claude.com/docs/en/env-vars (the `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` row, read 2026-10-17, does not mention the bubblewrap requirement); `anthropics/claude-code-action@a26b07d` `action.yml`, "Install subprocess isolation dependencies". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43 --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Refs: melodic-software/claude-code-plugins#7669
Summary
The review lanes (
pr-review.yml,pr-review-security.yml) get a one-time retry on a second token when the first attempt hits a usage limit. This PR also fixes four drift items from the claude-code-action audit (D3, D4, D5, D7) and adds a no-change skip for a restack that left the pull request's change as it was (#7669). Callers that pass no new secret or input keep today's single attempt.Fix
fallback-claude-code-oauth-token.report-lane-outcome'sclassify.cjsuses forclass=rate-limit; a test pins the two together.class=token. Only the final report names the run's class, so a fallback that then fails another way is never read as rate-limited bybabysit_merge.pyorbabysit_review_evidence.py.attempt) passes the chosen attempt's outcome, execution file, start time, budget and structured output to the verify, outcome, record and status steps. The structured output travels through a random 128-bit heredoc delimiter, and an empty fallback output never borrows the first attempt's. The verify window opens when the chosen attempt started.account=fallbackwhen the fallback token did the review. Without the secret, none of the new steps run.model(defaultsonnet) andeffort(defaulthigh) on both lanes. They are appended as--model/--effortafterclaude-args, so they win over a--modelpassed there.--model claude-sonnet-5is removed from theclaude-argsdefault. Values that are not a plain alias/ID, or not a known effort level, fail the compose step.modelinput.classify_inline_comments: false, so inline comments post as they are made and a step timeout cannot drop buffered findings.CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1"on the review steps. It strips credentials from Bash subprocesses and leaves GitHub tokens in place, sogh pr diffstill works.include_fix_links: false.<!-- claude-lane-reviewed-base ref=<base branch> merge-base=<sha> -->. The merge gate reads only the first line.skip=no-change, marker on the new head) only if all three hold:git --literal-pathspecs diff --raw <reviewed> <head> -- <those paths>is empty: same mode, type and blob. It runs after a--depth=1 --filter=blob:nonefetch of the reviewed head.pulls.getstill shows the run's head as the live head.The probe result needs one correction. In pr-pipeline-sandbox run 38965516737, the code lane did not skip because of restack handling; it also saw
affa9b3 is not an ancestor. It skipped because the sandbox'spr-review-no-botscontrol callspr-review.ymlwith the same lane id (claude-review) anddocs-only-paths: "**". That control's docs-only skip had already moved the sharedclaude-reviewmarker to597106f(comment 6224391858, updated 20:53:50) before the real lane read it.Merge-order dependency
babysit_review_evidence.pyRECORD_RE(claude-code-plugins, lines 55-61) is anchored with$and rejects a trailingaccount=fallback. The coordinator handles it in claude-code-plugins. That change must land before any caller passesfallback-claude-code-oauth-token.Changes needed outside this repository (not made here)
standards,
components/runner-policy/policy.json. Add a new entry for each lane at this PR's merge sha. Copy the v0.42.2 entries (pr-review.yml@a623e29…at line 124, and the matchingpr-review-security.yml@a623e29…entry), then change two things:allowedSecrets: add"fallback-claude-code-oauth-token": "${{ secrets.<FALLBACK_SECRET> }}". Per REVIEW-POLICY §3(b), that secret isAUTOMATIONS_CLAUDE_CODE_OAUTH_TOKEN.allowedInputs: add"model"and"effort"only if callers will pass them. Today's defaults need neither.standards,
components/runner-policy/README.md. Add the registration paragraph after line 1221 (the v0.42.2 paragraph). It should say:model/effortinputs;claude-sonnet-5to thesonnetalias;first-outcome,fallback,claude-review-fallbackandattempt;anthropics/claude-code-actionstep that receives the fallback secret;classify_inline_comments,include_fix_linksandCLAUDE_CODE_SUBPROCESS_ENV_SCRUBon both action steps;git fetch/git diff;runs-onchange.standards caller components (sync-managed). Repin
uses:and add the secret line under the existingCLAUDE_CODE_OAUTH_TOKEN:line:components/claude-lanes-hosted/claude-review.yml:uses:line 84, secrets line 96components/claude-lanes-hosted/claude-security-review.yml:uses:line 77, secrets line 89components/claude-lanes/claude-review.yml:uses:line 79, secrets line 91components/claude-lanes/claude-security-review.yml:uses:line 73, secrets line 85Verification
node --test .github/scripts/*.test.cjs .github/actions/report-lane-outcome/*.test.cjs: 425 pass, 0 fail.claude-lane-fallback.test.cjscovers:classify.cjson 13 execution-file shapes × timed-out or not, and no warning carriesclass=.outcome=/delimiter text that cannot set another output.id,ifand timeout.claude-lane-scope.test.cjscovers::.sameskips;mode(644→755) andtype(file→symlink) review.account=fallbackonly on a fallback review.actionlint(1.7.12): clean on every workflow.zizmor --offline: the same 2 mediumartipackedfindings asmain(the documented #1236 workaround). gitleaks on the diff: no leaks.sonnetalias and--efforton the CLI bundled with action v1.0.250;timeout-minutesat run time (actionlint accepts it);--depth=1fetch of a force-pushed-away reviewed head. If it does not, the run falls back to a whole review.Related
🤖 Generated with Claude Code