fix: use ResolveBeadsDir for polecat BEADS_DIR

Previously, polecat startup used hardcoded paths for BEADS_DIR that
didn't follow redirects for repos with tracked beads. This meant
polecats working in worktrees (where .beads/redirect points to the
actual beads location) would use the wrong beads directory.

Fixed locations:
- daemon.go: polecat startup now uses ResolveBeadsDir
- polecat/session_manager.go: session startup now uses ResolveBeadsDir

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
julianknutsen
2026-01-09 03:28:46 -08:00
committed by Steve Yegge
parent 7150ce2624
commit 1d88a73eaa
2 changed files with 6 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ import (
"strings"
"time"
"github.com/steveyegge/gastown/internal/beads"
"github.com/steveyegge/gastown/internal/config"
"github.com/steveyegge/gastown/internal/constants"
"github.com/steveyegge/gastown/internal/rig"
@@ -194,8 +195,8 @@ func (m *SessionManager) Start(polecat string, opts SessionStartOptions) error {
}
// Set beads environment for worktree polecats (non-fatal)
townRoot := filepath.Dir(m.rig.Path)
beadsDir := filepath.Join(townRoot, ".beads")
// Use ResolveBeadsDir to follow redirects for repos with tracked beads
beadsDir := beads.ResolveBeadsDir(m.rig.Path)
debugSession("SetEnvironment BEADS_DIR", m.tmux.SetEnvironment(sessionID, "BEADS_DIR", beadsDir))
debugSession("SetEnvironment BEADS_NO_DAEMON", m.tmux.SetEnvironment(sessionID, "BEADS_NO_DAEMON", "1"))
debugSession("SetEnvironment BEADS_AGENT_NAME", m.tmux.SetEnvironment(sessionID, "BEADS_AGENT_NAME", fmt.Sprintf("%s/%s", m.rig.Name, polecat)))