diff --git a/internal/cmd/statusline.go b/internal/cmd/statusline.go index f8f24b9d..a14b40a8 100644 --- a/internal/cmd/statusline.go +++ b/internal/cmd/statusline.go @@ -115,7 +115,7 @@ func runWorkerStatusLine(t *tmux.Tmux, session, rigName, polecat, crew, issue st // Priority 2: Fall back to GT_ISSUE env var or in_progress beads currentWork := issue if currentWork == "" && hookedWork == "" && session != "" { - currentWork = getCurrentWork(t, session, 40) + currentWork = getCurrentWork(t, session, identity, 40) } // Show hooked work (takes precedence) @@ -749,9 +749,15 @@ func getHookedWork(identity string, maxLen int, beadsDir string) string { return display } -// getCurrentWork returns a truncated title of the first in_progress issue. +// getCurrentWork returns a truncated title of the first in_progress issue assigned to this agent. // Uses the pane's working directory to find the beads. -func getCurrentWork(t *tmux.Tmux, session string, maxLen int) string { +func getCurrentWork(t *tmux.Tmux, session, identity string, maxLen int) string { + // Guard: identity must be non-empty to filter by assignee. + // Without identity, the query would return ALL in_progress beads regardless of assignee. + if identity == "" { + return "" + } + // Get the pane's working directory workDir, err := t.GetPaneWorkDir(session) if err != nil || workDir == "" { @@ -764,10 +770,11 @@ func getCurrentWork(t *tmux.Tmux, session string, maxLen int) string { return "" } - // Query beads for in_progress issues + // Query beads for in_progress issues assigned to this agent b := beads.New(workDir) issues, err := b.List(beads.ListOptions{ Status: "in_progress", + Assignee: identity, Priority: -1, }) if err != nil || len(issues) == 0 {