fix(sling): use --no-daemon consistently in bd calls (h-3f96b)
storeDispatcherInBead and storeAttachedMoleculeInBead were calling bd show/update without --no-daemon, while all other sling operations used --no-daemon. This inconsistency could cause daemon socket hangs if the daemon was in a bad state during sling operations. Changes: - Add --no-daemon --allow-stale to bd show calls in both functions - Add --no-daemon to bd update calls in both functions - Add empty stdout check for bd --no-daemon exit 0 bug Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -137,12 +137,18 @@ func storeDispatcherInBead(beadID, dispatcher string) error {
|
||||
}
|
||||
|
||||
// Get the bead to preserve existing description content
|
||||
showCmd := exec.Command("bd", "show", beadID, "--json")
|
||||
// Use --no-daemon for consistency with other sling operations (see h-3f96b)
|
||||
showCmd := exec.Command("bd", "--no-daemon", "show", beadID, "--json", "--allow-stale")
|
||||
out, err := showCmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("fetching bead: %w", err)
|
||||
}
|
||||
|
||||
// Handle bd --no-daemon exit 0 bug: empty stdout means not found
|
||||
if len(out) == 0 {
|
||||
return fmt.Errorf("bead not found")
|
||||
}
|
||||
|
||||
// Parse the bead
|
||||
var issues []beads.Issue
|
||||
if err := json.Unmarshal(out, &issues); err != nil {
|
||||
@@ -165,8 +171,8 @@ func storeDispatcherInBead(beadID, dispatcher string) error {
|
||||
// Update the description
|
||||
newDesc := beads.SetAttachmentFields(issue, fields)
|
||||
|
||||
// Update the bead
|
||||
updateCmd := exec.Command("bd", "update", beadID, "--description="+newDesc)
|
||||
// Update the bead (use --no-daemon for consistency)
|
||||
updateCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--description="+newDesc)
|
||||
updateCmd.Stderr = os.Stderr
|
||||
if err := updateCmd.Run(); err != nil {
|
||||
return fmt.Errorf("updating bead description: %w", err)
|
||||
@@ -190,12 +196,18 @@ func storeAttachedMoleculeInBead(beadID, moleculeID string) error {
|
||||
issue := &beads.Issue{}
|
||||
if logPath == "" {
|
||||
// Get the bead to preserve existing description content
|
||||
showCmd := exec.Command("bd", "show", beadID, "--json")
|
||||
// Use --no-daemon for consistency with other sling operations (see h-3f96b)
|
||||
showCmd := exec.Command("bd", "--no-daemon", "show", beadID, "--json", "--allow-stale")
|
||||
out, err := showCmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("fetching bead: %w", err)
|
||||
}
|
||||
|
||||
// Handle bd --no-daemon exit 0 bug: empty stdout means not found
|
||||
if len(out) == 0 {
|
||||
return fmt.Errorf("bead not found")
|
||||
}
|
||||
|
||||
// Parse the bead
|
||||
var issues []beads.Issue
|
||||
if err := json.Unmarshal(out, &issues); err != nil {
|
||||
@@ -225,8 +237,8 @@ func storeAttachedMoleculeInBead(beadID, moleculeID string) error {
|
||||
_ = os.WriteFile(logPath, []byte(newDesc), 0644)
|
||||
}
|
||||
|
||||
// Update the bead
|
||||
updateCmd := exec.Command("bd", "update", beadID, "--description="+newDesc)
|
||||
// Update the bead (use --no-daemon for consistency)
|
||||
updateCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--description="+newDesc)
|
||||
updateCmd.Stderr = os.Stderr
|
||||
if err := updateCmd.Run(); err != nil {
|
||||
return fmt.Errorf("updating bead description: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user