fix: Claude runner --output-file crash, PR_REF unbound, and Codex alignment#1645
fix: Claude runner --output-file crash, PR_REF unbound, and Codex alignment#1645
Conversation
The diagnostic block added in PR #1643 references PR_REF to show unpushed commits, but PR_REF is only in the commit step's env block, not the run step's. Under set -euo pipefail the unbound variable crashes the entire step, preventing Claude's output from being captured and the commit step from running. This is why PR #220's Claude runs produced zero output despite the runner fixes being present. Fix: use ${PR_REF:-} to safely handle the missing variable. Also add artifact upload step (mirrors reusable-codex-run.yml) so Claude's session JSONL, output, and analysis files are preserved for debugging even when the run fails. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
Automated Status SummaryHead SHA: 8245ea9
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScope
Tasks
Acceptance criteria
|
🤖 Keepalive Loop StatusPR #1645 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
There was a problem hiding this comment.
Pull request overview
Fixes a bash set -euo pipefail crash in reusable-claude-run.yml diagnostics when PR_REF is unset, and adds artifact uploading so Claude’s output/session logs are preserved for debugging failed runs.
Changes:
- Prevent
PR_REF: unbound variablein the post-run diagnostics by making the branch extraction nounset-safe. - Upload Claude output/session/analysis files as a GitHub Actions artifact (mirroring the Codex runner pattern).
…odex The --output-file flag does not exist in the Claude CLI, causing it to exit immediately with code 1 (unknown option). This was introduced in PR #1643 and is the root cause of Claude runs failing on PR #220. Changes to reusable-claude-run.yml: - Remove invalid --output-file and --output-format stream-json flags - Use shell redirect with tee for session logging + output capture - Use PIPESTATUS[0] to capture Claude exit code through the pipe - Rename session files from .jsonl to .log (Claude text != JSONL) - Add agents/*.md bootstrap file exclusion (matches Codex pattern) - Add cross-agent artifact exclusion (codex-session/analysis files) Changes to reusable-codex-run.yml: - Add cross-agent artifact exclusion for claude-* files so shared workspace artifacts don't leak into Codex commits https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
…ect branch
The post-run "Unpushed commits" diagnostic used ${PR_REF:-} but the
Run Claude step's env block never set PR_REF, so diag_branch was
always empty and the git-log range fell back to origin/HEAD..HEAD.
Add PR_REF: ${{ inputs.pr_ref }} to the env block so the diagnostic
shows commits relative to the actual PR branch.
Addresses review feedback from Copilot on PR #1645.
https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
actionlint/shellcheck flagged unquoted $status in the [ -ne ] test and exit command. Quote both to prevent globbing and word splitting. https://claude.ai/code/session_012WnYCcttvFEY3FETnhVcNL
Automated Status Summary
Scope
Tasks
Acceptance criteria
Acceptance criteria section missing from source issue.
Head SHA: 45051ac
Latest Runs: ⏳ queued — Gate
Required: gate: ⏳ queued
| Workflow / Job | Result | Logs |
|----------------|--------|------|
| Agents PR meta manager | ❔ in progress | View run |
| CI Autofix Loop | ✅ success | View run |
| Copilot code review | ❔ in progress | View run |
| Gate | ⏳ queued | View run |
| Health 40 Sweep | ❔ in progress | View run |
| Health 44 Gate Branch Protection | ❔ in progress | View run |
| Health 45 Agents Guard | ✅ success | View run |
| Health 50 Security Scan | ❔ in progress | View run |
| Maint 52 Validate Workflows | ✅ success | View run |
| PR 11 - Minimal invariant CI | ✅ success | View run |
| Selftest CI | ❔ in progress | View run |
Head SHA: bb4c686
Latest Runs: ✅ success — Gate
Required: gate: ✅ success