fix(sling): use bd native prefix routing instead of BEADS_DIR override
verifyBeadExists was setting BEADS_DIR to town root, which overrides bd's native prefix-based routing via routes.jsonl. This broke resolution of rig-level beads (e.g., gt-* beads routed via gt- -> gastown/mayor/rig). Fix: - Remove BEADS_DIR override in verifyBeadExists - Set cmd.Dir to town root so bd can find routes.jsonl - Apply same fix to getBeadInfo for consistency Now gt sling gt-xxx correctly finds beads using the same routing as bd show gt-xxx. (gt-l5qwb) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -680,11 +680,13 @@ func sessionToAgentID(sessionName string) string {
|
||||
}
|
||||
|
||||
// verifyBeadExists checks that the bead exists using bd show.
|
||||
// Uses bd's native prefix-based routing via routes.jsonl - do NOT set BEADS_DIR
|
||||
// as that overrides routing and breaks resolution of rig-level beads.
|
||||
func verifyBeadExists(beadID string) error {
|
||||
cmd := exec.Command("bd", "--no-daemon", "show", beadID, "--json")
|
||||
// Set BEADS_DIR to town root so hq-* beads are accessible
|
||||
// Run from town root so bd can find routes.jsonl for prefix-based routing.
|
||||
// Do NOT set BEADS_DIR - that overrides routing and breaks rig bead resolution.
|
||||
if townRoot, err := workspace.FindFromCwd(); err == nil {
|
||||
cmd.Env = append(os.Environ(), "BEADS_DIR="+filepath.Join(townRoot, ".beads"))
|
||||
cmd.Dir = townRoot
|
||||
}
|
||||
if err := cmd.Run(); err != nil {
|
||||
@@ -701,8 +703,13 @@ type beadInfo struct {
|
||||
}
|
||||
|
||||
// getBeadInfo returns status and assignee for a bead.
|
||||
// Uses bd's native prefix-based routing via routes.jsonl.
|
||||
func getBeadInfo(beadID string) (*beadInfo, error) {
|
||||
cmd := exec.Command("bd", "--no-daemon", "show", beadID, "--json")
|
||||
// Run from town root so bd can find routes.jsonl for prefix-based routing.
|
||||
if townRoot, err := workspace.FindFromCwd(); err == nil {
|
||||
cmd.Dir = townRoot
|
||||
}
|
||||
out, err := cmd.Output()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("bead '%s' not found", beadID)
|
||||
|
||||
Reference in New Issue
Block a user