fix: align assigneeID format with hooked issue format (#946)

The polecat manager was using rig/name format while sling sets
rig/polecats/name. This caused gt polecat status to show 'done'
for working polecats because GetAssignedIssue couldn't find them.

Fixes gt-oohy
This commit is contained in:
Artem Bambalov
2026-01-26 04:05:44 +02:00
committed by GitHub
parent 6d18e0a88b
commit c94a2301eb
3 changed files with 57 additions and 55 deletions

View File

@@ -90,9 +90,9 @@ func NewManager(r *rig.Rig, g *git.Git, t *tmux.Tmux) *Manager {
}
// assigneeID returns the beads assignee identifier for a polecat.
// Format: "rig/polecatName" (e.g., "gastown/Toast")
// Format: "rig/polecats/polecatName" (e.g., "gastown/polecats/Toast")
func (m *Manager) assigneeID(name string) string {
return fmt.Sprintf("%s/%s", m.rig.Name, name)
return fmt.Sprintf("%s/polecats/%s", m.rig.Name, name)
}
// agentBeadID returns the agent bead ID for a polecat.
@@ -265,8 +265,8 @@ func (m *Manager) buildBranchName(name, issue string) string {
// {year} and {month}
now := time.Now()
vars["{year}"] = now.Format("06") // YY format
vars["{month}"] = now.Format("01") // MM format
vars["{year}"] = now.Format("06") // YY format
vars["{month}"] = now.Format("01") // MM format
// {name}
vars["{name}"] = name
@@ -1108,13 +1108,13 @@ func (m *Manager) CleanupStaleBranches() (int, error) {
// StalenessInfo contains details about a polecat's staleness.
type StalenessInfo struct {
Name string
CommitsBehind int // How many commits behind origin/main
HasActiveSession bool // Whether tmux session is running
HasUncommittedWork bool // Whether there's uncommitted or unpushed work
AgentState string // From agent bead (empty if no bead)
IsStale bool // Overall assessment: safe to clean up
Reason string // Why it's considered stale (or not)
Name string
CommitsBehind int // How many commits behind origin/main
HasActiveSession bool // Whether tmux session is running
HasUncommittedWork bool // Whether there's uncommitted or unpushed work
AgentState string // From agent bead (empty if no bead)
IsStale bool // Overall assessment: safe to clean up
Reason string // Why it's considered stale (or not)
}
// DetectStalePolecats identifies polecats that are candidates for cleanup.