Repository navigation
fix(ci): resume sign-off verifier when it stops without a verdict - #5209
Conversation
- Resume the same Claude session once if it ends without writing the verdict file - Log the agent's stop reason, final message, and permission denials - Fail the Check sign-off job when no verdict is produced
There was a problem hiding this comment.
Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.
Beyond the inline finding, I also checked the new failure path. When the resume step is skipped, its outcome is skipped, which passes the != 'failure' check. succeeded is written to GITHUB_OUTPUT before the exit 1, so the job output is still set. publish uses always(), so it still runs and posts the fallback comment when verify fails.
Extended reasoning...
The change touches only the claude-code-action steps in the verify job of .github/workflows/codeowner-signoff-verify.yml. The publish job (needs verify, if: always()) and how it reads verification-succeeded were checked against the new exit 1 and found unaffected.
| continue-on-error: true | ||
| env: | ||
| EXECUTION_FILE: ${{ steps.claude.outputs.execution_file }} | ||
| run: jq -r "$CLAUDE_RUN_SUMMARY_JQ" "$EXECUTION_FILE" | ||
|
|
||
| - name: Check for verdict |
There was a problem hiding this comment.
🟡 (optional) Untrusted PR text can now plant runner commands such as ::add-mask:: or ::error:: in the verify job log, which the base never printed. The summary steps echo the agent's final message and denied commands to stdout with jq -r. The runner runs any line that starts with :: as a workflow command. Fix: wrap both summary steps in ::stop-commands::<random token> … ::<token>:: so agent text prints literally. One way is to set the CLAUDE_RUN_SUMMARY_JQ output between those markers using a fresh token from openssl rand -hex 16.
Why this was flagged
The verifier agent reads untrusted PR diffs and comments. Text there can steer its final .result message or the tool_input.command of a denied tool call to include a line such as ::add-mask::Permission denials or ::error title=...::. The new steps "Summarize Claude run" (line 210-215) and "Summarize resumed Claude run" both run jq -r "$CLAUDE_RUN_SUMMARY_JQ" "$EXECUTION_FILE", which writes those strings raw to stdout, and the runner treats them as workflow commands. The result is forged error annotations on the sign-off run, or masked log lines that hide the denial diagnostics this PR adds. On the base branch nothing from the agent reached stdout, because claude-code-action keeps the transcript hidden. continue-on-error: true and the missing step id limit damage to the step's own outputs. They do not stop the runner from processing annotations, add-mask or stop-commands.
Verification: Line 215, the new "Summarize Claude run" step, runs jq -r "$CLAUDE_RUN_SUMMARY_JQ" "$EXECUTION_FILE". The resumed-run summary step does the same. Neither step uses ::stop-commands:: or escapes anything. On the base branch none of this agent text was printed. So this is a new channel from PR-influenced text to runner command parsing.
- Agent output can be steered by PR text, so wrap it in ::stop-commands:: with a random token
Problem
The
Check sign-offjob sometimes finishes its Claude step withis_error: falsebut never writes/tmp/codeowner-signoff-verdict.md. The job still shows green, the verdict upload is skipped, and the publisher posts the fallback "The verifier did not produce a valid verdict" REJECTED comment.On 2026-11-24 this happened to the first sign-off run on #5157 and #5120 (both passed on rerun) and to all three attempts on #5109 (run 45470730833). Those runs stopped after 52 to 64 turns. Runs that wrote a verdict took 88 to 112. The action hides the transcript, so the logs don't show why the agent stopped.
Change
In
codeowner-signoff-verify.yml,verifyjob:VERIFIER_CLAUDE_ARGSso both Claude steps share them.execution_file. It includes the stop subtype, turn count, the agent's final message, and each permission denial (tool plus command or path). The full transcript stays hidden.--resume <session_id>) with a prompt to finish the remaining checks, write the verdict, and runsignoff_validate. Resuming keeps the work already done, so this is cheaper than starting over.Record verification outcomenow fails the job when there is still no verdict, so the failure shows up in the run status. Publishing is unchanged:publishstill runs and posts the fallback comment.Notes
claude-code-actionpassing--resumethroughclaude_argsto the CLI. The first real no-verdict run will confirm it.--allowedTools. That list is unchanged in this PR.zizmorreports no findings.actionlintonly reports the existing$/.github/actions/...local-action references.