diff --git a/internal/cmd/crew_at.go b/internal/cmd/crew_at.go index ae5e99a5..e2373a59 100644 --- a/internal/cmd/crew_at.go +++ b/internal/cmd/crew_at.go @@ -91,6 +91,7 @@ func runCrewAt(cmd *cobra.Command, args []string) error { } // Set environment (non-fatal: session works without these) + _ = t.SetEnvironment(sessionID, "GT_ROLE", "crew") _ = t.SetEnvironment(sessionID, "GT_RIG", r.Name) _ = t.SetEnvironment(sessionID, "GT_CREW", name) @@ -120,7 +121,9 @@ func runCrewAt(cmd *cobra.Command, args []string) error { // Use respawn-pane to replace shell with Claude directly // This gives cleaner lifecycle: Claude exits → session ends (no intermediate shell) // Pass "gt prime" as initial prompt so Claude loads context immediately - claudeCmd := `claude --dangerously-skip-permissions "gt prime"` + // Export GT_ROLE and BD_ACTOR since tmux SetEnvironment only affects new panes + bdActor := fmt.Sprintf("%s/crew/%s", r.Name, name) + claudeCmd := fmt.Sprintf(`export GT_ROLE=crew GT_RIG=%s GT_CREW=%s BD_ACTOR=%s && claude --dangerously-skip-permissions "gt prime"`, r.Name, name, bdActor) if err := t.RespawnPane(paneID, claudeCmd); err != nil { return fmt.Errorf("starting claude: %w", err) } @@ -143,7 +146,9 @@ func runCrewAt(cmd *cobra.Command, args []string) error { // Use respawn-pane to replace shell with Claude directly // Pass "gt prime" as initial prompt so Claude loads context immediately - claudeCmd := `claude --dangerously-skip-permissions "gt prime"` + // Export GT_ROLE and BD_ACTOR since tmux SetEnvironment only affects new panes + bdActor := fmt.Sprintf("%s/crew/%s", r.Name, name) + claudeCmd := fmt.Sprintf(`export GT_ROLE=crew GT_RIG=%s GT_CREW=%s BD_ACTOR=%s && claude --dangerously-skip-permissions "gt prime"`, r.Name, name, bdActor) if err := t.RespawnPane(paneID, claudeCmd); err != nil { return fmt.Errorf("restarting claude: %w", err) } diff --git a/internal/cmd/crew_lifecycle.go b/internal/cmd/crew_lifecycle.go index 4538aa48..cc8fda92 100644 --- a/internal/cmd/crew_lifecycle.go +++ b/internal/cmd/crew_lifecycle.go @@ -221,6 +221,7 @@ func runCrewRestart(cmd *cobra.Command, args []string) error { } // Set environment + t.SetEnvironment(sessionID, "GT_ROLE", "crew") t.SetEnvironment(sessionID, "GT_RIG", r.Name) t.SetEnvironment(sessionID, "GT_CREW", name) @@ -234,7 +235,10 @@ func runCrewRestart(cmd *cobra.Command, args []string) error { } // Start claude with skip permissions (crew workers are trusted) - if err := t.SendKeys(sessionID, "claude --dangerously-skip-permissions"); err != nil { + // Export GT_ROLE and BD_ACTOR since tmux SetEnvironment only affects new panes + bdActor := fmt.Sprintf("%s/crew/%s", r.Name, name) + claudeCmd := fmt.Sprintf("export GT_ROLE=crew GT_RIG=%s GT_CREW=%s BD_ACTOR=%s && claude --dangerously-skip-permissions", r.Name, name, bdActor) + if err := t.SendKeys(sessionID, claudeCmd); err != nil { return fmt.Errorf("starting claude: %w", err) } diff --git a/internal/cmd/molecule_status.go b/internal/cmd/molecule_status.go index d2a3f579..be00f2d3 100644 --- a/internal/cmd/molecule_status.go +++ b/internal/cmd/molecule_status.go @@ -27,7 +27,7 @@ type MoleculeProgressInfo struct { Complete bool `json:"complete"` } -// MoleculeStatusInfo contains status information for an agent's hook. +// MoleculeStatusInfo contains status information for an agent's work. type MoleculeStatusInfo struct { Target string `json:"target"` Role string `json:"role"` diff --git a/internal/templates/templates_test.go b/internal/templates/templates_test.go index 4e814510..06437809 100644 --- a/internal/templates/templates_test.go +++ b/internal/templates/templates_test.go @@ -102,8 +102,8 @@ func TestRenderRole_Deacon(t *testing.T) { if !strings.Contains(output, "Patrol Executor") { t.Error("output missing role description") } - if !strings.Contains(output, "Patrol Execution Protocol") { - t.Error("output missing patrol execution section") + if !strings.Contains(output, "Startup Protocol: Propulsion") { + t.Error("output missing startup protocol section") } if !strings.Contains(output, "mol-deacon-patrol") { t.Error("output missing patrol molecule reference")