π The fast, Pythonic way to build MCP servers and clients.
Pin Claude Code to 2.1.215 in the sandboxed Marvin workflows (#4645)
Jeremiah Lowin387a063aec2a
diff --git a/.github/workflows/marvin-dedupe-issues.yml b/.github/workflows/marvin-dedupe-issues.ymlindex c98bc1312..a9de7d0d3 100644--- a/.github/workflows/marvin-dedupe-issues.yml+++ b/.github/workflows/marvin-dedupe-issues.yml@@ -19,6 +19,13 @@ jobs:issues: writeid-token: write+ # TEMPORARY PIN β see the matching note in marvin-label-triage.yml.+ # Claude Code 2.1.216 broke every Bash call under the action's subprocess+ # isolation, which this workflow needs for all of its `gh` searching.+ # https://github.com/anthropics/claude-code/issues/79997+ env:+ PINNED_CLAUDE_CODE_VERSION: "2.1.215"+steps:- name: Checkout repositoryuses: actions/checkout@v7@@ -91,9 +98,17 @@ jobs:- name: Clean up stale Claude locksrun: rm -rf ~/.claude/.locks ~/.local/state/claude/locks || true+ - name: Install pinned Claude Code+ id: pin-claude+ run: |+ curl -fsSL https://claude.ai/install.sh | bash -s -- "$PINNED_CLAUDE_CODE_VERSION"+ echo "path=$HOME/.local/bin/claude" >> "$GITHUB_OUTPUT"+ "$HOME/.local/bin/claude" --version+- name: Run Marvin dedupe commanduses: anthropics/claude-code-action@v1with:+ path_to_claude_code_executable: ${{ steps.pin-claude.outputs.path }}github_token: ${{ steps.marvin-token.outputs.token }}bot_name: "Marvin Context Protocol"prompt: ${{ steps.dedupe-prompt.outputs.PROMPT }}diff --git a/.github/workflows/marvin-label-triage.yml b/.github/workflows/marvin-label-triage.ymlindex aef7d9e2a..334879ac9 100644--- a/.github/workflows/marvin-label-triage.yml+++ b/.github/workflows/marvin-label-triage.yml@@ -27,6 +27,22 @@ jobs:issues: writepull-requests: write+ # TEMPORARY PIN β remove once upstream ships a fix.+ #+ # Claude Code 2.1.216 regressed the sandbox that claude-code-action wraps+ # every Bash call in when `allowed_non_write_users` is set: the mountpoint+ # walk fails closed, so every command β down to `true` β dies with+ # `bwrap: Can't create file at /home/.mcp.json: Permission denied`.+ # Marvin still reads the issue and picks correct labels, then cannot run+ # the helper that applies them, so triage silently applied zero labels+ # from 2026-07-20 onward while every run reported success.+ #+ # 2.1.215 is the last release without the regression.+ # https://github.com/anthropics/claude-code/issues/79997+ # https://github.com/anthropics/claude-code-action/issues/1547+ env:+ PINNED_CLAUDE_CODE_VERSION: "2.1.215"+steps:- name: Checkout base repositoryuses: actions/checkout@v7@@ -142,10 +158,21 @@ jobs:- name: Clean up stale Claude locksrun: rm -rf ~/.claude/.locks ~/.local/state/claude/locks || true+ # Mirrors how the action installs Claude Code itself, minus the version+ # it hardcodes. Passing path_to_claude_code_executable makes the action+ # skip its own install and use this build.+ - name: Install pinned Claude Code+ id: pin-claude+ run: |+ curl -fsSL https://claude.ai/install.sh | bash -s -- "$PINNED_CLAUDE_CODE_VERSION"+ echo "path=$HOME/.local/bin/claude" >> "$GITHUB_OUTPUT"+ "$HOME/.local/bin/claude" --version+- name: Run Marvin for Issue Triageid: marvinuses: anthropics/claude-code-action@v1with:+ path_to_claude_code_executable: ${{ steps.pin-claude.outputs.path }}github_token: ${{ steps.marvin-token.outputs.token }}bot_name: "Marvin Context Protocol"prompt: ${{ steps.triage-prompt.outputs.PROMPT }}@@ -173,7 +200,7 @@ jobs:# agent reaching for something never on the allowlist (falling back to# `gh issue view` when the API is down, say) is behaving normally, and# failing on that would cry wolf during every GitHub incident.- - name: Fail if an allowlisted tool was denied+ - name: Fail if Marvin could not run its toolsif: always() && steps.marvin.conclusion != 'skipped'env:EXECUTION_FILE: ${{ steps.marvin.outputs.execution_file }}@@ -222,6 +249,38 @@ jobs:echo "::notice::Marvin was denied $total call(s), none of them to tools this workflow grants. That is expected when it probes for a tool we deliberately withhold; the allowlist is intact."fi+ # A granted tool can also fail *after* the permission check, which the+ # denial count above cannot see. Claude Code 2.1.216 did exactly that:+ # the sandbox refused to build and every Bash call β including the+ # labeling helper β exited 1 with `bwrap: ...`, while the run stayed+ # green. Correlate results back to their Bash tool_use rather than+ # grepping the whole log, so an issue body quoting a sandbox error+ # cannot fail an otherwise healthy run.+ if ! sandbox=$(jq -sr '+ [ .[] | if type == "array" then .[] else . end ]+ | map(select(type == "object" and (.type == "assistant" or .type == "user")))+ | map(.message.content // []) | flatten+ | map(select(type == "object"))+ | . as $blocks+ | ( $blocks+ | map(select(.type == "tool_use" and .name == "Bash"))+ | map(.id) ) as $bash+ | $blocks+ | map(select(.type == "tool_result" and (.tool_use_id as $i | $bash | index($i))))+ | map(.content | tostring)+ | map(select(test("bwrap:|Failed to (start|create) sandbox")))+ | "\(length)\t\(.[0] // "" | gsub("[\t\n]"; " ") | .[0:200])"+ ' "$file"); then+ echo "::error::Could not scan Marvin execution log for sandbox failures ($file)."+ exit 1+ fi+ IFS=$'\t' read -r sandbox_failures sandbox_sample <<<"$sandbox"++ if [[ "$sandbox_failures" -gt 0 ]]; then+ echo "::error::Marvin's Bash tool failed $sandbox_failures time(s) inside the action's subprocess sandbox, so it could not apply labels: ${sandbox_sample}. This is an environment failure, not a prompt or allowlist problem β check whether the pinned Claude Code version (${PINNED_CLAUDE_CODE_VERSION}) still avoids the upstream sandbox regression."+ exit 1+ fi+- name: Upload Marvin execution logif: always() && steps.marvin.conclusion != 'skipped'uses: actions/upload-artifact@v4