Skip to content

fix(#1236): show exec error when validation script fails to run - #1238

Merged
rh-hemartin merged 2 commits into
mainfrom
fullsend/code/issue-1236
Jun 8, 2026
Merged

fix(#1236): show exec error when validation script fails to run#1238
rh-hemartin merged 2 commits into
mainfrom
fullsend/code/issue-1236

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

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

  • Branch is not main/master (fullsend/code/issue-1236)
  • Secret scan passed (gitleaks — 7813c92add42ca3ba723cf83de489fd6a67d442a..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

Site preview

Preview: https://87d5c3a9-site.fullsend-ai.workers.dev

Commit: 724e5e0b1ee5c90bbfb506f1350efd14f629ed43

@fullsend-ai-review

fullsend-ai-review Bot commented May 20, 2026

Copy link
Copy Markdown

Review

Findings

Low

  • [nil safety] internal/cli/run.go:1021validationFailMessage 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.
    Remediation: Add a nil check: if execErr != nil { return execErr.Error() } return "unknown error"
Previous run

Review

Findings

No findings.

Previous run (2)

Review

Findings

No findings.

Previous run (3)

Review

Findings

No findings.

@fullsend-ai-review fullsend-ai-review Bot added the ready-for-merge All reviewers approved — ready to merge label May 20, 2026
@rh-hemartin rh-hemartin self-assigned this May 20, 2026
@ralphbean

Copy link
Copy Markdown
Member

/fs-fix is there a test that covers this new conditional?

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. no test covering the empty-output fallback conditional (internal/cli/run.go): Extracted the inline msg-building logic into a validationFailMessage helper function and added four unit tests: output present (uses output), empty output (falls back to exec error), whitespace-only output (falls back to exec error), and output trimming.

Tests: passed

Decision points
  • Extracted inline logic into a helper function rather than testing runAgent end-to-end (alternatives: Integration test of runAgent with a missing validation script, Table-driven test with mock exec.Cmd; rationale: runAgent has extensive dependencies (filesystem, subprocesses, harness config) making integration tests impractical. A small pure-function helper is the idiomatic Go approach and matches the existing test patterns in run_test.go.)

Updated by fullsend fix agent

fullsend-ai-coder Bot pushed a commit that referenced this pull request May 26, 2026
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>
@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed ready-for-merge All reviewers approved — ready to merge labels May 26, 2026
rh-hemartin pushed a commit that referenced this pull request May 28, 2026
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>
@rh-hemartin
rh-hemartin force-pushed the fullsend/code/issue-1236 branch from 744cf63 to c669099 Compare May 28, 2026 09:15
@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed ready-for-merge All reviewers approved — ready to merge labels May 28, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jun 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 8, 2026
fullsend-code and others added 2 commits June 8, 2026 08:19
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>
Comment thread internal/cli/run.go
func validationFailMessage(output []byte, execErr error) string {
if msg := strings.TrimSpace(string(output)); msg != "" {
return msg
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[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"

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge and removed ready-for-merge All reviewers approved — ready to merge labels Jun 8, 2026
@rh-hemartin
rh-hemartin added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit efbd31c Jun 8, 2026
15 of 19 checks passed
@rh-hemartin
rh-hemartin deleted the fullsend/code/issue-1236 branch June 8, 2026 09:13
@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #1238 — show exec error when validation script fails

Timeline: 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 (ralphbean) noticed missing tests and triggered /fs-fix. Fix agent added 4 tests in ~7 min. PR then waited another 13 days for human approval and merge (2026-06-08). Total: 19 days, 1 rework cycle.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-merge All reviewers approved — ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

validation failed shows empty message when script fails to exec (ENOENT / EACCES)

2 participants