From 4d3ad460f2f31514e564dd01b1f5baf11a2deb77 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 17 Oct 2026 14:43:26 -0400 Subject: [PATCH 1/3] fix(review): install bubblewrap before the Claude review lanes run #756 set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on both review steps. Claude Code v2.1.300 refuses to start on Linux with the scrub on unless bubblewrap is installed, and claude-code-action installs it only when allowed_non_write_users is set, which these lanes never set. Every v0.44.0 lane run failed to install Claude Code three times. Install bubblewrap (and lift Ubuntu 24.04's AppArmor userns restriction) before the lanes, mirroring the action's own isolation step, so the scrub stays on. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n --- .github/workflows/pr-review-security.yml | 21 +++++++++++++++++++++ .github/workflows/pr-review.yml | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/.github/workflows/pr-review-security.yml b/.github/workflows/pr-review-security.yml index 113fe208..9da16448 100644 --- a/.github/workflows/pr-review-security.yml +++ b/.github/workflows/pr-review-security.yml @@ -486,6 +486,27 @@ jobs: core.setOutput("scope", "whole"); } + # Claude Code refuses to start with CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on + # Linux unless bubblewrap is installed. The action installs it only when + # allowed_non_write_users is set (claude-code-action@a26b07d action.yml + # "Install subprocess isolation dependencies"), which these lanes never + # set, so this repeats that step. Ubuntu 24.04's AppArmor blocks the + # unprivileged user namespaces bubblewrap needs; the same sysctl lifts it. + # A failure here surfaces as the review step's install error, which the + # outcome step classifies. + - name: Install subprocess isolation dependencies + if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' + continue-on-error: true + timeout-minutes: 5 + run: | + if ! command -v bwrap >/dev/null; then + sudo apt-get -o Acquire::Retries=3 update -qq + sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap + fi + if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + fi + # The model, effort, inline-comment and plugin-command Skill grants go # after the caller's args so replacing claude-args cannot drop them, and # so does the schema, which makes the action return the findings count diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 6464c97a..4681b59d 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -529,6 +529,27 @@ jobs: echo "note=FULL DIFF: the whole pull request's diff ($files files) is in $DIFF_FILE. Read it to see every change; \`gh pr diff\` and the API can return only part of a large pull request." } >> "$GITHUB_OUTPUT" + # Claude Code refuses to start with CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on + # Linux unless bubblewrap is installed. The action installs it only when + # allowed_non_write_users is set (claude-code-action@a26b07d action.yml + # "Install subprocess isolation dependencies"), which these lanes never + # set, so this repeats that step. Ubuntu 24.04's AppArmor blocks the + # unprivileged user namespaces bubblewrap needs; the same sysctl lifts it. + # A failure here surfaces as the review step's install error, which the + # outcome step classifies. + - name: Install subprocess isolation dependencies + if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' + continue-on-error: true + timeout-minutes: 5 + run: | + if ! command -v bwrap >/dev/null; then + sudo apt-get -o Acquire::Retries=3 update -qq + sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap + fi + if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + fi + # The model, effort, inline-comment and plugin-command Skill grants go # after the caller's args so replacing claude-args cannot drop them, and # so does the schema, which makes the action return the findings count From 378b4e15e4ba3d449b50c67134d87c5d14c50a55 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 17 Oct 2026 14:53:55 -0400 Subject: [PATCH 2/3] fix(review): bound the bubblewrap step and lift userns only when needed Cap the install step at one minute so it stays inside the job's allowance outside the review step, and change the AppArmor sysctl only when bwrap cannot start, so a runner that already works keeps its kernel setting. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n --- .github/workflows/pr-review-security.yml | 15 +++++++++------ .github/workflows/pr-review.yml | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-review-security.yml b/.github/workflows/pr-review-security.yml index 9da16448..b33f2f52 100644 --- a/.github/workflows/pr-review-security.yml +++ b/.github/workflows/pr-review-security.yml @@ -490,20 +490,23 @@ jobs: # Linux unless bubblewrap is installed. The action installs it only when # allowed_non_write_users is set (claude-code-action@a26b07d action.yml # "Install subprocess isolation dependencies"), which these lanes never - # set, so this repeats that step. Ubuntu 24.04's AppArmor blocks the - # unprivileged user namespaces bubblewrap needs; the same sysctl lifts it. - # A failure here surfaces as the review step's install error, which the - # outcome step classifies. + # set, so this repeats that step. Ubuntu 24.04's AppArmor can block the + # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts + # it, here only when bwrap cannot start, so a runner that works as it is + # keeps its kernel setting. A failure here surfaces as the review step's + # install error, which the outcome step classifies. One minute keeps the + # step inside the job's allowance outside the review step. - name: Install subprocess isolation dependencies if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' continue-on-error: true - timeout-minutes: 5 + timeout-minutes: 1 run: | if ! command -v bwrap >/dev/null; then sudo apt-get -o Acquire::Retries=3 update -qq sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap fi - if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then + if ! bwrap --ro-bind / / true 2>/dev/null && + [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 fi diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 4681b59d..3069b20d 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -533,20 +533,23 @@ jobs: # Linux unless bubblewrap is installed. The action installs it only when # allowed_non_write_users is set (claude-code-action@a26b07d action.yml # "Install subprocess isolation dependencies"), which these lanes never - # set, so this repeats that step. Ubuntu 24.04's AppArmor blocks the - # unprivileged user namespaces bubblewrap needs; the same sysctl lifts it. - # A failure here surfaces as the review step's install error, which the - # outcome step classifies. + # set, so this repeats that step. Ubuntu 24.04's AppArmor can block the + # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts + # it, here only when bwrap cannot start, so a runner that works as it is + # keeps its kernel setting. A failure here surfaces as the review step's + # install error, which the outcome step classifies. One minute keeps the + # step inside the job's allowance outside the review step. - name: Install subprocess isolation dependencies if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' continue-on-error: true - timeout-minutes: 5 + timeout-minutes: 1 run: | if ! command -v bwrap >/dev/null; then sudo apt-get -o Acquire::Retries=3 update -qq sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap fi - if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then + if ! bwrap --ro-bind / / true 2>/dev/null && + [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 fi From ae1350a3abf607b9a62acc03434f75044d6e6821 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sat, 17 Oct 2026 15:02:11 -0400 Subject: [PATCH 3/3] fix(review): lift userns only for an installed bwrap; state the timeout trade-off Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n --- .github/workflows/pr-review-security.yml | 7 ++++--- .github/workflows/pr-review.yml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr-review-security.yml b/.github/workflows/pr-review-security.yml index b33f2f52..a9e9e220 100644 --- a/.github/workflows/pr-review-security.yml +++ b/.github/workflows/pr-review-security.yml @@ -494,8 +494,9 @@ jobs: # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts # it, here only when bwrap cannot start, so a runner that works as it is # keeps its kernel setting. A failure here surfaces as the review step's - # install error, which the outcome step classifies. One minute keeps the - # step inside the job's allowance outside the review step. + # install error, which the outcome step classifies. The one-minute cap + # can push the job past its timeout only when the review step also runs + # to its own timeout, a run that fails either way. - name: Install subprocess isolation dependencies if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' continue-on-error: true @@ -505,7 +506,7 @@ jobs: sudo apt-get -o Acquire::Retries=3 update -qq sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap fi - if ! bwrap --ro-bind / / true 2>/dev/null && + if command -v bwrap >/dev/null && ! bwrap --ro-bind / / true 2>/dev/null && [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 fi diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 3069b20d..b1f6dde7 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -537,8 +537,9 @@ jobs: # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts # it, here only when bwrap cannot start, so a runner that works as it is # keeps its kernel setting. A failure here surfaces as the review step's - # install error, which the outcome step classifies. One minute keeps the - # step inside the job's allowance outside the review step. + # install error, which the outcome step classifies. The one-minute cap + # can push the job past its timeout only when the review step also runs + # to its own timeout, a run that fails either way. - name: Install subprocess isolation dependencies if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' continue-on-error: true @@ -548,7 +549,7 @@ jobs: sudo apt-get -o Acquire::Retries=3 update -qq sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap fi - if ! bwrap --ro-bind / / true 2>/dev/null && + if command -v bwrap >/dev/null && ! bwrap --ro-bind / / true 2>/dev/null && [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 fi