Skip to content

fix: salvage completed review retry output - #62

Merged
Troublor merged 3 commits into
mainfrom
Troublor/fix/salvage-review-retry
Nov 24, 2026
Merged

Troublor merged 3 commits into
mainfrom
Troublor/fix/salvage-review-retry

Conversation

@Troublor

@Troublor Troublor commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Recover a completed retry review from the SDK execution transcript when the pinned vendor wrapper rejects it before exporting structured output. Keep the normal compiler and publication path, and preserve the first attempt's transcript before the retry reuses the vendor's execution-file path.

Evidence from megaeth-labs/mega-agents#366 on November 24, 2026:

  • 00:51:46.75Z: the first attempt ended with terminal_reason: max_turns / error_max_turns and no structured output.
  • 00:56:28.96Z: the retry returned a completed SDK result with a populated structured_output object.
  • 00:56:29.21Z: anthropics/claude-code-action@5ef2e550a465a721f4f45e4a7d3c340c873e1dcc rejected that successful result because it reported 67 turns against the configured maximum of 66. The action failed before exporting structured output, so compilation and publication were skipped and the report emitted MODEL_ACTION_FAILED.
  • 00:56:29.61Z: both transcript captures copied /home/runner/work/_temp/claude-execution-output.json, after the retry had replaced the first attempt's record.

The fix belongs in our wrapper because we cannot patch the pinned third-party action. Salvage reads only top-level completed, successful SDK result records containing a non-empty JSON object. It rejects malformed, partial, max-turns, stream-event, tool-use, and non-object output and never reconstructs a result from prose. Existing action outputs retain priority.

The retry failure remains visible in step outcomes, but a successful compile permits normal publication and prevents an obsolete MODEL_ACTION_FAILED report. The run summary explicitly notes when retry output was salvaged after a wrapper turn-count rejection.

Test plan

PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/actions/claude-pr-review -p 'test_*.py' -v
Ran 120 tests in 0.046s
OK (skipped=1)
  • The one skip is the existing consumer claude.yml test, which does not apply to this repository.
  • Regression tests cover JSONL and JSON-array extraction, invalid transcript rejection, normal output priority, compilation/report recovery, action conditions, and running both capture scripts against a reused execution-file path.
  • New salvage tests fail against the unchanged base implementation.
  • YAML parsing, all nine action shell scripts with bash -n, and git diff --check pass.
  • MISE_SHELLCHECK_VERSION=0.11.0 actionlint -color reports the pre-existing SC2001 warning at .github/workflows/actions-test.yml:243. This workflow is unchanged.
  • python3 .github/scripts/action_docs.py --check exits 0; the generated README.md step list is regenerated in 8ac938d for the two added steps.
  • No live review workflow was rerun. The vendor action and GitHub publication are covered locally through transcript fixtures and existing pipeline tests.

Review

Independent review of 5172d68 (opus-5-5) returned APPROVE with two MEDIUM findings; both are fixed in 4d18644:

  • M1 stale retry transcript: the preserve branch is now scoped to analysis-transcript.json, and salvage is gated on steps.review_retry.outcome == 'failure'.
  • M2 weak wiring test: the test now matches each full if: line and runs the capture scripts against a state dir that already holds a stale retry transcript.

@Troublor
Troublor merged commit 8ed3a54 into main Nov 24, 2026
13 checks passed
@Troublor
Troublor deleted the Troublor/fix/salvage-review-retry branch November 24, 2026 01:43
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.

1 participant