From f5f225428156f4b8fb218e4fd2b17e7945aac49b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 14:28:21 +0000 Subject: [PATCH 1/3] ci(review): keep Claude Code Review subagents in the foreground The review's first turn launched a background eligibility subagent, then ended its turn waiting for it. Ending the turn ends the headless job, so no review ran (run 37478584859, job 112320461611). Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01K5rAHJfvZyEEaUQghV7hCQ --- .github/workflows/claude-code-review.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index ca6db21c..9b3f31b5 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -47,8 +47,14 @@ jobs: prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment' # The inline-comment MCP server is only installed when its tool is # listed here; tool list from the action's docs/solutions.md review example. + # Run 37478584859 (job 112320461611): the review's first turn launched a + # background subagent for the eligibility check, then its second turn + # said "Waiting for the eligibility check to finish" and ended. Ending + # the turn ends this headless job, so no review ran. The appended + # system prompt keeps every subagent in the foreground. claude_args: | --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" + --append-system-prompt "Run every subagent in the foreground: set run_in_background to false on each Agent call, and do not end your turn while a subagent is still running." # Without this the job log hides the whole run ("full output hidden for # security"), so a review that stops after two turns and posts nothing # cannot be diagnosed. The log is readable by anyone who can read this From 50f5ca31cdf1b328dfd66485657a0f18416e0e22 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 6 Oct 2026 14:31:55 +0000 Subject: [PATCH 2/3] ci(review): disable background tasks for Claude Code Review The failing run left run_in_background unset and the harness still started the subagent in the background, so a prompt instruction alone is the weaker lever. Set CLAUDE_CODE_DISABLE_BACKGROUND_TASKS and keep the prompt line. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01K5rAHJfvZyEEaUQghV7hCQ --- .github/workflows/claude-code-review.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 9b3f31b5..725ad0fc 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -38,6 +38,13 @@ jobs: - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@v1 + # In that run the Agent call left run_in_background unset and the harness + # still started it in the background (subagent_stats: requested unset 1, + # started_in_background 1). This variable is the CLI's switch for turning + # background task functionality off; the appended system prompt below is + # the backup if the variable does not reach the CLI process. + env: + CLAUDE_CODE_DISABLE_BACKGROUND_TASKS: '1' with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' From 8cf7339dc7235e810aa854766cfe6ead172d2cd9 Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Wed, 7 Oct 2026 01:56:06 +1100 Subject: [PATCH 3/3] ci(review): rely on foreground-task environment control --- .github/workflows/claude-code-review.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 725ad0fc..51247041 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -54,14 +54,11 @@ jobs: prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }} --comment' # The inline-comment MCP server is only installed when its tool is # listed here; tool list from the action's docs/solutions.md review example. - # Run 37478584859 (job 112320461611): the review's first turn launched a - # background subagent for the eligibility check, then its second turn - # said "Waiting for the eligibility check to finish" and ended. Ending - # the turn ends this headless job, so no review ran. The appended - # system prompt keeps every subagent in the foreground. + # Run 37478584859 (job 112320461611) ended while an eligibility + # subagent was still running. The documented environment control above + # forces Agent calls to stay in the foreground for this headless job. claude_args: | --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)" - --append-system-prompt "Run every subagent in the foreground: set run_in_background to false on each Agent call, and do not end your turn while a subagent is still running." # Without this the job log hides the whole run ("full output hidden for # security"), so a review that stops after two turns and posts nothing # cannot be diagnosed. The log is readable by anyone who can read this