Repository navigation
fix(#1169): write a provisional review result before synthesis - #1918
Merged
Merged
Conversation
The review orchestrator only wrote agent-result.json in the final pr-review step, so any session that ended early (crash, kill, or a clean stop after the issue-labels step with no label_actions) left no file. Validation then failed and the post-script posted nothing, which hid completed sub-agent findings from the PR author. - agents/review.md: add a provisional `failure` result (reason tool-failure) written as soon as the PR is identified, overwritten by the final result; run the label step before the final write and state that it never ends the run. - skills/pr-review/SKILL.md: point step 1 at the provisional write and make step 7 write the result after the label step even with no labels. Kept within the skillsaw context-budget ceiling. - docs/review.md: describe the provisional result and add a troubleshooting row for the resulting tool-failure notice. - scripts/pr-review-provisional-result-test.sh (wired into make test): runs the documented jq template, validates it against the review schema, checks a final result overwrites it, and pins the guidance. The provisional result is a failure notice, not a partial review, per the agent's "report failure rather than a partial review" constraint. Runner-side diagnostics for sessions that end without output are out of scope here (tracked in fullsend-ai/fullsend#7042). Note: pre-commit could not fetch hook repos (TLS error in sandbox); hooks were run directly instead: pre-commit-hooks 6.0.0 checks, shellcheck 0.10.0.1, lint-agent-docs, lint-release-cases, scan-secrets (gitleaks). make could not spawn /bin/sh in the sandbox, so the pr-review, post-review and review-body-fallback test scripts and skillsaw 0.18.0 --strict were run directly; all passed. Closes #1169 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Finished Review · ✅ Success · Started 4:15 AM UTC · Completed 4:23 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.81 |
|
Risk Assessment: elevated (3/5) DetailsTouches multiple protected paths and CI configuration in core review orchestrator files with high git churn and regression history, modifying existing behavior without a feature flag despite moderate change size and well-scoped issue alignment. |
ReviewFindingsMedium
Labels: The PR fixes a reliability bug in the review agent (issue #1169). |
ggallen
approved these changes
Nov 9, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This changes the review agent's instructions so a review run always leaves a schema-valid
agent-result.json, even when the session ends early.agents/review.md: as soon as the PR is identified, the orchestrator now writes a provisionalfailureresult (reason: tool-failure). The final result overwrites it. The contextual-labels step now runs before the final write, and the text says outright that it never ends the run, with or withoutlabel_actions.skills/pr-review/SKILL.md: step 1 points to the provisional write. Step 7 writes the result after the label step, even when there are no labels. The skill stays under its skillsaw context-budget ceiling (17,101 tokens; the ceiling is 17,111).docs/review.md: explains the provisional result and adds a troubleshooting row for theReason: tool-failurenotice it produces.scripts/pr-review-provisional-result-test.sh(added tomake test): runs the documented jq template, checks the output againstschemas/review-result.schema.jsonwithvalidate-output-schema.sh, checks that a final result overwrites it, and pins the guidance wording.Why
Before this change,
agent-result.jsonwas only written in the last pr-review step. Every early exit reported in the issue left no file behind: a crash before synthesis, a kill, or a clean stop right afterissue-labelsreturned "Nolabel_actionsto emit". Validation then failed and the post-script was skipped, so nothing was posted on the PR. With this change, those runs post a "PR was NOT reviewed" failure notice instead of failing silently.Design notes
failureresult counts as a passed validation. Todayvalidation_loop.max_iterationsis 1, so this changes nothing. Once run: a timed-out validation-loop iteration must not retry from scratch; export the budget and send a wrap-up signal fullsend#7042 brings back retries, a session that dies after step 1 will post the notice instead of retrying. Revisit this then.Testing
bash scripts/pr-review-provisional-result-test.sh: passes. Also passing:pr-review-challenger-contract-test.sh,pr-review-remediation-test.sh,pr-review-dependency-scope-test.sh,post-review-test.sh,review-body-fallback-test.sh.skillsaw 0.18.0 --strict: 0 errors.hack/lint-agent-docs,eval/lint-release-cases.py, and gitleaks viascan-secrets.makecouldn't spawn/bin/shin the sandbox, so I ran the test scripts above directly rather than throughmake test.These paths are protected (
agents/,skills/,scripts/), so a human needs to approve.🤖 Generated with Claude Code
Closes #1169
Post-script verification
agent/1169-review-provisional-result)e41be7b41a17e17686425892a2f4968031f7a92b..HEAD)