fix: handle bd --no-daemon exit code 0 bug on not-found (#339)
When bd --no-daemon show <id> does not find an issue, it incorrectly exits with code 0 (success) but writes the error to stderr and leaves stdout empty. This causes JSON parse failures throughout gt when code tries to unmarshal the empty stdout. This PR handles the bug defensively in all affected code paths: - beads.go run(): Detect empty stdout + non-empty stderr as error - beads.go wrapError(): Add 'no issue found' to ErrNotFound patterns - sling.go: Check len(out) == 0 in multiple functions - convoy.go getIssueDetails(): Check stdout.Len() == 0 - prime_molecule.go: Check stdout.Len() == 0 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
b9025379b7
commit
d126c967a0
@@ -44,6 +44,12 @@ func showMoleculeExecutionPrompt(workDir, moleculeID string) {
|
||||
fmt.Printf(" Check status with: bd mol current %s\n", moleculeID)
|
||||
return
|
||||
}
|
||||
// Handle bd --no-daemon exit 0 bug: empty stdout means not found
|
||||
if stdout.Len() == 0 {
|
||||
fmt.Println(style.Bold.Render("→ PROPULSION PRINCIPLE: Work is on your hook. RUN IT."))
|
||||
fmt.Println(" Begin working on this molecule immediately.")
|
||||
return
|
||||
}
|
||||
|
||||
// Parse JSON output - it's an array with one element
|
||||
var outputs []MoleculeCurrentOutput
|
||||
|
||||
Reference in New Issue
Block a user