fix(#1997): notify issue when pre-commit blocks PR creation - #1998
fix(#1997): notify issue when pre-commit blocks PR creation#1998fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
When post-code.sh's authoritative pre-commit check fails, the bash ERR trap does not fire because the pre-commit command runs inside an `if` conditional. The script exits non-zero but never posts a comment to the source issue, leaving humans with no feedback. Add an explicit failure comment in the pre-commit block path that: - Distinguishes "agent wrote code, PR blocked by pre-commit" from generic push/PR failures and agent crashes - Includes the workflow run link for easy log access - Shows the last 30 lines of hook output in a collapsed details block so the human can see which hooks failed - Suggests retrying with /fs-code or fixing locally Also capture pre-commit output to a temp file via tee so the excerpt can be included in the comment. The temp file is cleaned up on both success and failure paths. Add corresponding tests to post-code-test.sh that verify the comment body content, org-mode URL routing, and absence of generic push/PR failure language. Note: pre-commit could not run in sandbox (Go toolchain permission error). The post-script runs pre-commit authoritatively on the runner. Closes #1997
Site previewPreview: https://8ba89b4b-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsMedium
Low
Info
|
|
We have something opened that will shape this how this is done (closing for now until #1871 gets merged). |
Retro: PR #1998 — pre-commit failure notification (closed without merge)Timeline
AssessmentWasted work: The full triage → code → review pipeline completed (~30 min of agent compute), but the PR was discarded because a related in-flight PR changes the implementation surface. The triage agent identified #1859 as related but didn't escalate this to a blocking dependency. Review quality was strong: The injection finding on Existing issue overlap: #1650 covers issues that directly reference open PRs in their text, but not the transitive case demonstrated here (triage discovers related issue → that issue has an open PR that changes the implementation approach). One proposal filed below to address this gap. Proposals filed
|
When post-code.sh's authoritative pre-commit check fails, the bash ERR trap does not fire because the pre-commit command runs inside an
ifconditional. The script exits non-zero but never posts a comment to the source issue, leaving humans with no feedback.Add an explicit failure comment in the pre-commit block path that:
generic push/PR failures and agent crashes
block so the human can see which hooks failed
Also capture pre-commit output to a temp file via tee so the excerpt can be included in the comment. The temp file is cleaned up on both success and failure paths.
Add corresponding tests to post-code-test.sh that verify the comment body content, org-mode URL routing, and absence of generic push/PR failure language.
Note: pre-commit could not run in sandbox (Go toolchain permission error). The post-script runs pre-commit authoritatively on the runner.
Closes #1997
Post-script verification
agent/1997-precommit-failure-notification)9ea038f26b4c37a1000c1fe5a42303217a79357b..HEAD)