diff --git a/internal/cmd/crew_at.go b/internal/cmd/crew_at.go index d8a6918d..c5241abf 100644 --- a/internal/cmd/crew_at.go +++ b/internal/cmd/crew_at.go @@ -250,8 +250,22 @@ func runCrewAt(cmd *cobra.Command, args []string) error { Topic: "restart", }) + // Ensure tmux session environment is set (for gt status-line to read). + // Sessions created before this was added may be missing GT_CREW, etc. + envVars := config.AgentEnv(config.AgentEnvConfig{ + Role: "crew", + Rig: r.Name, + AgentName: name, + TownRoot: townRoot, + RuntimeConfigDir: claudeConfigDir, + BeadsNoDaemon: true, + }) + for k, v := range envVars { + _ = t.SetEnvironment(sessionID, k, v) + } + // Use respawn-pane to replace shell with runtime directly - // Export GT_ROLE and BD_ACTOR since tmux SetEnvironment only affects new panes + // Export GT_ROLE and BD_ACTOR in the command since pane inherits from shell, not session env startupCmd, err := config.BuildCrewStartupCommandWithAgentOverride(r.Name, name, r.Path, beacon, crewAgentOverride) if err != nil { return fmt.Errorf("building startup command: %w", err) diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go index 2edf1be8..f8f24b9d 100644 --- a/internal/cmd/statusline.go +++ b/internal/cmd/statusline.go @@ -713,6 +713,12 @@ func getMailPreviewWithRoot(identity string, maxLen int, townRoot string) (int, // beadsDir should be the directory containing .beads (for rig-level) or // empty to use the town root (for town-level roles). func getHookedWork(identity string, maxLen int, beadsDir string) string { + // Guard: identity must be non-empty to filter by assignee. + // Without identity, the query would return ALL hooked beads regardless of assignee. + if identity == "" { + return "" + } + // If no beadsDir specified, use town root if beadsDir == "" { var err error