From 90a3c58f1882d9d2a1d199b1116b4f9a6976644b Mon Sep 17 00:00:00 2001 From: propane Date: Fri, 23 Jan 2026 15:56:58 -0800 Subject: [PATCH] fix(statusline): filter in_progress beads by identity in getCurrentWork The getCurrentWork function was returning ANY in_progress bead from the workspace rather than only beads assigned to the current agent. This caused crew workers to see wisps assigned to polecats in their status bar. Changes: - Add identity parameter to getCurrentWork function - Add identity guard (return empty if identity is empty) - Filter by Assignee in the beads query This complements the earlier getHookedWork fix and ensures both hooked AND in_progress beads are filtered by the agent's identity. Fixes gt-zxnr (additional fix). Co-Authored-By: Claude Opus 4.5 --- internal/cmd/statusline.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 {