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:
@@ -202,6 +202,7 @@ func startDeaconSession(t *tmux.Tmux) error {
|
||||
|
||||
// Set environment
|
||||
_ = t.SetEnvironment(DeaconSessionName, "GT_ROLE", "deacon")
|
||||
_ = t.SetEnvironment(DeaconSessionName, "BD_ACTOR", "deacon")
|
||||
|
||||
// Apply Deacon theme
|
||||
theme := tmux.DeaconTheme()
|
||||
@@ -210,8 +211,8 @@ func startDeaconSession(t *tmux.Tmux) error {
|
||||
// Launch Claude directly (no shell respawn loop)
|
||||
// Restarts are handled by daemon via ensureDeaconRunning on each heartbeat
|
||||
// The startup hook handles context loading automatically
|
||||
// Export GT_ROLE in the command since tmux SetEnvironment only affects new panes
|
||||
if err := t.SendKeys(DeaconSessionName, "export GT_ROLE=deacon && claude --dangerously-skip-permissions"); err != nil {
|
||||
// Export GT_ROLE and BD_ACTOR in the command since tmux SetEnvironment only affects new panes
|
||||
if err := t.SendKeys(DeaconSessionName, "export GT_ROLE=deacon BD_ACTOR=deacon && claude --dangerously-skip-permissions"); err != nil {
|
||||
return fmt.Errorf("sending command: %w", err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user