feat: Set BD_ACTOR env var when spawning agents (gt-rhfji)
When gt spawns agents (polecats, crew, patrol roles), it now sets the BD_ACTOR env var so that bd commands (like `bd hook`) know the agent identity without coupling to gt. Updated spawn points: - gt up (mayor, deacon, witness via ensureSession/ensureWitness) - gt deacon start - gt witness start - gt start refinery - gt mayor start - Daemon deacon restart - Daemon lifecycle restart - Handoff respawn - Refinery manager start BD_ACTOR uses slash format (e.g., gastown/witness, gastown/crew/max) while GT_ROLE may use dash format internally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -200,9 +200,11 @@ func (m *Manager) Start(foreground bool) error {
|
||||
}
|
||||
|
||||
// Set environment variables
|
||||
bdActor := fmt.Sprintf("%s/refinery", m.rig.Name)
|
||||
_ = 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)
|
||||
|
||||
// Set beads environment - refinery uses rig-level beads
|
||||
beadsDir := filepath.Join(m.rig.Path, "mayor", "rig", ".beads")
|
||||
|
||||
Reference in New Issue
Block a user