fix(statusline): filter in_progress beads by identity in getCurrentWork
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 25s
CI / Test (push) Failing after 2m15s
CI / Lint (push) Failing after 26s
CI / Integration Tests (push) Successful in 1m35s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
Some checks failed
CI / Check for .beads changes (push) Has been skipped
CI / Check embedded formulas (push) Failing after 25s
CI / Test (push) Failing after 2m15s
CI / Lint (push) Failing after 26s
CI / Integration Tests (push) Successful in 1m35s
CI / Coverage Report (push) Has been skipped
Windows CI / Windows Build and Unit Tests (push) Has been cancelled
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user