Merge remote-tracking branch 'origin/polecat/shiny-mk0vvt3o'

This commit is contained in:
mayor
2026-01-05 19:39:00 -08:00
committed by beads/crew/dave
2 changed files with 20 additions and 9 deletions

View File

@@ -1130,8 +1130,9 @@ func getIssueDetailsBatch(issueIDs []string) map[string]*issueDetails {
return result return result
} }
// Build args: bd show id1 id2 id3 ... --json // Build args: bd --no-daemon show id1 id2 id3 ... --json
args := append([]string{"show"}, issueIDs...) // Use --no-daemon to ensure fresh data (avoid stale cache from daemon)
args := append([]string{"--no-daemon", "show"}, issueIDs...)
args = append(args, "--json") args = append(args, "--json")
showCmd := exec.Command("bd", args...) showCmd := exec.Command("bd", args...)
@@ -1177,7 +1178,8 @@ func getIssueDetailsBatch(issueIDs []string) map[string]*issueDetails {
// Prefer getIssueDetailsBatch for multiple issues to avoid N+1 subprocess calls. // Prefer getIssueDetailsBatch for multiple issues to avoid N+1 subprocess calls.
func getIssueDetails(issueID string) *issueDetails { func getIssueDetails(issueID string) *issueDetails {
// Use bd show with routing - it should find the issue in the right rig // Use bd show with routing - it should find the issue in the right rig
showCmd := exec.Command("bd", "show", issueID, "--json") // Use --no-daemon to ensure fresh data (avoid stale cache)
showCmd := exec.Command("bd", "--no-daemon", "show", issueID, "--json")
var stdout bytes.Buffer var stdout bytes.Buffer
showCmd.Stdout = &stdout showCmd.Stdout = &stdout

View File

@@ -405,11 +405,15 @@ func runSling(cmd *cobra.Command, args []string) error {
} }
// Hook the bead using bd update // Hook the bead using bd update
// Set BEADS_DIR to town-level beads so hq-* beads are accessible // For town-level beads (hq-*), set BEADS_DIR to town beads
// even when running from polecat worktree (which only sees gt-* via redirect) // For rig-level beads (gt-*, bd-*, etc.), use redirect-based routing from hookWorkDir
hookCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--status=hooked", "--assignee="+targetAgent) hookCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--status=hooked", "--assignee="+targetAgent)
hookCmd.Env = append(os.Environ(), "BEADS_DIR="+townBeadsDir) if strings.HasPrefix(beadID, "hq-") {
if hookWorkDir != "" { // Town-level bead: set BEADS_DIR explicitly
hookCmd.Env = append(os.Environ(), "BEADS_DIR="+townBeadsDir)
hookCmd.Dir = townRoot
} else if hookWorkDir != "" {
// Rig-level bead: use redirect from polecat's worktree
hookCmd.Dir = hookWorkDir hookCmd.Dir = hookWorkDir
} else { } else {
hookCmd.Dir = townRoot hookCmd.Dir = townRoot
@@ -1364,9 +1368,14 @@ func runBatchSling(beadIDs []string, rigName string, townBeadsDir string) error
} }
// Hook the bead // Hook the bead
// For town-level beads (hq-*), set BEADS_DIR; for rig-level beads use redirect
hookCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--status=hooked", "--assignee="+targetAgent) hookCmd := exec.Command("bd", "--no-daemon", "update", beadID, "--status=hooked", "--assignee="+targetAgent)
hookCmd.Env = append(os.Environ(), "BEADS_DIR="+townBeadsDir) if strings.HasPrefix(beadID, "hq-") {
if hookWorkDir != "" { // Town-level bead: set BEADS_DIR and run from town root (parent of townBeadsDir)
hookCmd.Env = append(os.Environ(), "BEADS_DIR="+townBeadsDir)
hookCmd.Dir = filepath.Dir(townBeadsDir)
} else if hookWorkDir != "" {
// Rig-level bead: use redirect from polecat's worktree
hookCmd.Dir = hookWorkDir hookCmd.Dir = hookWorkDir
} }
hookCmd.Stderr = os.Stderr hookCmd.Stderr = os.Stderr