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:
committed by
Steve Yegge
parent
7150ce2624
commit
1d88a73eaa
@@ -851,7 +851,9 @@ func (d *Daemon) restartPolecatSession(rigName, polecatName, sessionName string)
|
|||||||
envVars := config.RoleEnvVars("polecat", rigName, polecatName)
|
envVars := config.RoleEnvVars("polecat", rigName, polecatName)
|
||||||
|
|
||||||
// Add polecat-specific beads configuration
|
// Add polecat-specific beads configuration
|
||||||
beadsDir := filepath.Join(d.config.TownRoot, rigName, ".beads")
|
// Use ResolveBeadsDir to follow redirects for repos with tracked beads
|
||||||
|
rigPath := filepath.Join(d.config.TownRoot, rigName)
|
||||||
|
beadsDir := beads.ResolveBeadsDir(rigPath)
|
||||||
envVars["BEADS_DIR"] = beadsDir
|
envVars["BEADS_DIR"] = beadsDir
|
||||||
envVars["BEADS_NO_DAEMON"] = "1"
|
envVars["BEADS_NO_DAEMON"] = "1"
|
||||||
envVars["BEADS_AGENT_NAME"] = fmt.Sprintf("%s/%s", rigName, polecatName)
|
envVars["BEADS_AGENT_NAME"] = fmt.Sprintf("%s/%s", rigName, polecatName)
|
||||||
@@ -871,7 +873,6 @@ func (d *Daemon) restartPolecatSession(rigName, polecatName, sessionName string)
|
|||||||
|
|
||||||
// Launch Claude with environment exported inline
|
// Launch Claude with environment exported inline
|
||||||
// Pass rigPath so rig agent settings are honored (not town-level defaults)
|
// Pass rigPath so rig agent settings are honored (not town-level defaults)
|
||||||
rigPath := filepath.Join(d.config.TownRoot, rigName)
|
|
||||||
startCmd := config.BuildStartupCommand(envVars, rigPath, "")
|
startCmd := config.BuildStartupCommand(envVars, rigPath, "")
|
||||||
if err := d.tmux.SendKeys(sessionName, startCmd); err != nil {
|
if err := d.tmux.SendKeys(sessionName, startCmd); err != nil {
|
||||||
return fmt.Errorf("sending startup command: %w", err)
|
return fmt.Errorf("sending startup command: %w", err)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/steveyegge/gastown/internal/beads"
|
||||||
"github.com/steveyegge/gastown/internal/config"
|
"github.com/steveyegge/gastown/internal/config"
|
||||||
"github.com/steveyegge/gastown/internal/constants"
|
"github.com/steveyegge/gastown/internal/constants"
|
||||||
"github.com/steveyegge/gastown/internal/rig"
|
"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)
|
// Set beads environment for worktree polecats (non-fatal)
|
||||||
townRoot := filepath.Dir(m.rig.Path)
|
// Use ResolveBeadsDir to follow redirects for repos with tracked beads
|
||||||
beadsDir := filepath.Join(townRoot, ".beads")
|
beadsDir := beads.ResolveBeadsDir(m.rig.Path)
|
||||||
debugSession("SetEnvironment BEADS_DIR", m.tmux.SetEnvironment(sessionID, "BEADS_DIR", beadsDir))
|
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_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)))
|
debugSession("SetEnvironment BEADS_AGENT_NAME", m.tmux.SetEnvironment(sessionID, "BEADS_AGENT_NAME", fmt.Sprintf("%s/%s", m.rig.Name, polecat)))
|
||||||
|
|||||||
Reference in New Issue
Block a user