refactor: update managers to use RoleEnvVars
Consolidates all role startup code to use the shared RoleEnvVars() function, ensuring consistent env vars across tmux SetEnvironment and Claude startup command exports. Updated: - Mayor manager - Deacon startup (daemon.go) - Witness manager - Refinery manager - Polecat startup (daemon.go) - BuildPolecatStartupCommand, BuildCrewStartupCommand helpers This ensures all agents receive the same identity env vars regardless of startup path. 🤖 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
2343e6b0ef
commit
7150ce2624
@@ -186,17 +186,23 @@ func (m *Manager) Start(foreground bool) error {
|
||||
}
|
||||
|
||||
// Set environment variables (non-fatal: session works without these)
|
||||
_ = t.SetEnvironment(sessionID, "GT_RIG", m.rig.Name)
|
||||
_ = t.SetEnvironment(sessionID, "GT_REFINERY", "1")
|
||||
_ = t.SetEnvironment(sessionID, "GT_ROLE", "refinery")
|
||||
_ = t.SetEnvironment(sessionID, "BD_ACTOR", bdActor)
|
||||
// Use shared RoleEnvVars for consistency across all role startup paths
|
||||
envVars := config.RoleEnvVars("refinery", m.rig.Name, "")
|
||||
|
||||
// Set beads environment - refinery uses rig-level beads (non-fatal)
|
||||
// Add refinery-specific flag
|
||||
envVars["GT_REFINERY"] = "1"
|
||||
|
||||
// Add beads environment - refinery uses rig-level beads
|
||||
// Use ResolveBeadsDir to handle both tracked (mayor/rig) and local beads
|
||||
beadsDir := beads.ResolveBeadsDir(m.rig.Path)
|
||||
_ = t.SetEnvironment(sessionID, "BEADS_DIR", beadsDir)
|
||||
_ = t.SetEnvironment(sessionID, "BEADS_NO_DAEMON", "1")
|
||||
_ = t.SetEnvironment(sessionID, "BEADS_AGENT_NAME", fmt.Sprintf("%s/refinery", m.rig.Name))
|
||||
envVars["BEADS_DIR"] = beadsDir
|
||||
envVars["BEADS_NO_DAEMON"] = "1"
|
||||
envVars["BEADS_AGENT_NAME"] = envVars["BD_ACTOR"]
|
||||
|
||||
// Set all env vars in tmux session (for debugging) and they'll also be exported to Claude
|
||||
for k, v := range envVars {
|
||||
_ = t.SetEnvironment(sessionID, k, v)
|
||||
}
|
||||
|
||||
// Apply theme (non-fatal: theming failure doesn't affect operation)
|
||||
theme := tmux.AssignTheme(m.rig.Name)
|
||||
|
||||
Reference in New Issue
Block a user