fix(rig): Use correct beads path during rig/crew creation (GHI #7)
initAgentBeads and crew_add were looking for beads at mayor/rig/.beads/ but during initial creation, beads is at rig root. The redirect mechanism to mayor/rig/.beads/ gets set up later. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
17fd366888
commit
9cb33ee289
@@ -56,9 +56,8 @@ func runCrewAdd(cmd *cobra.Command, args []string) error {
|
|||||||
crewGit := git.NewGit(r.Path)
|
crewGit := git.NewGit(r.Path)
|
||||||
crewMgr := crew.NewManager(r, crewGit)
|
crewMgr := crew.NewManager(r, crewGit)
|
||||||
|
|
||||||
// Beads for agent bead creation
|
// Beads for agent bead creation (use rig root where .beads/ lives)
|
||||||
rigBeadsPath := filepath.Join(r.Path, "mayor", "rig")
|
bd := beads.New(r.Path)
|
||||||
bd := beads.New(rigBeadsPath)
|
|
||||||
|
|
||||||
// Track results
|
// Track results
|
||||||
var created []string
|
var created []string
|
||||||
|
|||||||
@@ -437,8 +437,8 @@ func (m *Manager) initBeads(rigPath, prefix string) error {
|
|||||||
//
|
//
|
||||||
// Agent beads track lifecycle state for ZFC compliance (gt-h3hak, gt-pinkq).
|
// Agent beads track lifecycle state for ZFC compliance (gt-h3hak, gt-pinkq).
|
||||||
func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig bool) error {
|
func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig bool) error {
|
||||||
// Run bd commands from mayor/rig which has the beads database
|
// Run bd commands from rig root where .beads/ was initialized
|
||||||
mayorRigPath := filepath.Join(rigPath, "mayor", "rig")
|
// Set BEADS_DIR explicitly to ensure bd finds the database
|
||||||
beadsDir := filepath.Join(rigPath, ".beads")
|
beadsDir := filepath.Join(rigPath, ".beads")
|
||||||
prevBeadsDir, hadBeadsDir := os.LookupEnv("BEADS_DIR")
|
prevBeadsDir, hadBeadsDir := os.LookupEnv("BEADS_DIR")
|
||||||
if err := os.Setenv("BEADS_DIR", beadsDir); err != nil {
|
if err := os.Setenv("BEADS_DIR", beadsDir); err != nil {
|
||||||
@@ -451,7 +451,7 @@ func (m *Manager) initAgentBeads(rigPath, rigName, prefix string, isFirstRig boo
|
|||||||
_ = os.Unsetenv("BEADS_DIR")
|
_ = os.Unsetenv("BEADS_DIR")
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
bd := beads.New(mayorRigPath)
|
bd := beads.New(rigPath)
|
||||||
|
|
||||||
// Define agents to create
|
// Define agents to create
|
||||||
type agentDef struct {
|
type agentDef struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user