fix(#1236): show exec error when validation script fails to run - #1238
Conversation
Site previewPreview: https://87d5c3a9-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsLow
Previous runReviewFindingsNo findings. Previous run (2)ReviewFindingsNo findings. Previous run (3)ReviewFindingsNo findings. |
|
/fs-fix is there a test that covers this new conditional? |
🔧 Fix agent — iteration 1 (human-triggered)Extracted the empty-output fallback conditional into a testable validationFailMessage helper and added 4 unit tests covering all branches. All tests pass. Fixed (1):
Tests: passed Decision points
Updated by fullsend fix agent |
Extract the empty-output fallback logic into a validationFailMessage helper and add four test cases covering: output present, empty output falling back to exec error, whitespace-only output, and output trimming. Addresses review feedback on #1238 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: fullsend-fix <fullsend-code@users.noreply.github.com>
Extract the empty-output fallback logic into a validationFailMessage helper and add four test cases covering: output present, empty output falling back to exec error, whitespace-only output, and output trimming. Addresses review feedback on #1238 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: fullsend-fix <fullsend-code@users.noreply.github.com>
744cf63 to
c669099
Compare
When a validation script cannot be executed (e.g., ENOENT or EACCES), CombinedOutput() returns empty output with a non-nil error. Previously the failure message used only the (empty) output, producing a blank "Validation failed:" message. Now falls back to the exec error string when output is empty, giving operators the actual diagnostic. Closes #1236 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract the empty-output fallback logic into a validationFailMessage helper and add four test cases covering: output present, empty output falling back to exec error, whitespace-only output, and output trimming. Addresses review feedback on #1238 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: fullsend-fix <fullsend-code@users.noreply.github.com>
c669099 to
724e5e0
Compare
| func validationFailMessage(output []byte, execErr error) string { | ||
| if msg := strings.TrimSpace(string(output)); msg != "" { | ||
| return msg | ||
| } |
There was a problem hiding this comment.
[low] nil safety
validationFailMessage will panic with a nil-pointer dereference if execErr is nil and output is empty/whitespace. The current call site (line 697) is safe because it is guarded by if valErr == nil { break }, but the function itself has no nil guard, making it fragile if reused elsewhere in the package.
Suggested fix: Add a nil check: if execErr != nil { return execErr.Error() } return "unknown error"
Retro: PR #1238 — show exec error when validation script failsTimeline: Issue #1236 opened 2026-05-20, code agent produced PR in ~9 min, review agent approved with 1 low nil-safety finding. PR sat for 6 days until a human ( Key observation: The code agent fixed the bug correctly but shipped no tests. A human had to manually request test coverage, causing a full rework cycle (fix agent + re-review). This is the primary efficiency loss. Existing issue #1354 covers the review agent detecting missing tests, but no open issue proposes that the code agent itself should proactively write regression tests for bug fixes. Skipped proposals (covered by existing issues):
Proposals filed
|
When a validation script cannot be executed (e.g., ENOENT or EACCES), CombinedOutput() returns empty output with a non-nil error. Previously the failure message used only the (empty) output, producing a blank "Validation failed:" message. Now falls back to the exec error string when output is empty, giving operators the actual diagnostic.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Closes #1236
Post-script verification
fullsend/code/issue-1236)7813c92add42ca3ba723cf83de489fd6a67d442a..HEAD)