Skip to content

fix: Claude runner --output-file crash, PR_REF unbound, and Codex alignment#1645

Merged
stranske merged 4 commits intomainfrom
claude/debug-keepalive-workflow-88W3o
Feb 24, 2026
Merged

fix: Claude runner --output-file crash, PR_REF unbound, and Codex alignment#1645
stranske merged 4 commits intomainfrom
claude/debug-keepalive-workflow-88W3o

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Feb 23, 2026

Source: Issue #220

Automated Status Summary

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

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

Workflow / Job Result Logs
.github/workflows/autofix.yml ❌ failure View run
Agents PR meta manager ❔ in progress View run
Gate ✅ success View run
Health 40 Sweep ✅ success View run
Health 44 Gate Branch Protection ✅ success View run
Health 45 Agents Guard ✅ success View run
Health 50 Security Scan ✅ success View run
Health 73 Template Completeness ✅ success View run
Keepalive E2E ✅ success View run
Maint 52 Validate Workflows ✅ success View run
PR 11 - Minimal invariant CI ✅ success View run
Selftest CI ✅ success View run
Validate Sync Manifest ✅ success View run

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
Copilot AI review requested due to automatic review settings February 23, 2026 20:39
@stranske stranske temporarily deployed to agent-high-privilege February 23, 2026 20:39 — with GitHub Actions Inactive
@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 23, 2026

Automated Status Summary

Head SHA: 8245ea9
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / guard
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 93.12%
Baseline 85.00%
Delta +8.12%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
src/cli_parser.py 81.8% 4
src/percentile_calculator.py 95.0% 1
src/aggregator.py 95.0% 2
src/__init__.py 100.0% 0
src/ndjson_parser.py 100.0% 0

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

  • Scope section missing from source issue.

Tasks

  • Tasks section missing from source issue.

Acceptance criteria

  • Acceptance criteria section missing from source issue.

  • [ ]

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

agents-workflows-bot bot commented Feb 23, 2026

🤖 Keepalive Loop Status

PR #1645 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/18 complete
Timeout 45 min (default)
Timeout usage 3m elapsed (7%, 42m remaining)
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 variable in 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
@stranske stranske temporarily deployed to agent-high-privilege February 24, 2026 04:05 — with GitHub Actions Inactive
@stranske stranske changed the title fix: unbound PR_REF crashes Claude runner diagnostics + add artifact upload fix: Claude runner --output-file crash, PR_REF unbound, and Codex alignment Feb 24, 2026
…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
@stranske stranske temporarily deployed to agent-high-privilege February 24, 2026 04:27 — with GitHub Actions Inactive
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
@stranske stranske temporarily deployed to agent-high-privilege February 24, 2026 04:46 — with GitHub Actions Inactive
@stranske stranske merged commit fcdf695 into main Feb 24, 2026
316 of 326 checks passed
@stranske stranske deleted the claude/debug-keepalive-workflow-88W3o branch February 24, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants