fix: gt hook uses --status=hooked for consistency with gt sling (gt-frhcq.1)
The gt hook command was using --status=pinned while gt sling and the rest of the codebase use --status=hooked. This inconsistency meant gt hook would not find beads hooked by gt sling, and vice versa. Changes: - hook.go: Use beads.StatusHooked instead of beads.StatusPinned - hook.go: Update bd update command to use --status=hooked - unsling.go: Use beads.StatusHooked when finding hooked beads - Update error messages and comments to say "hooked" instead of "pinned" This fix ensures gt hook works uniformly for all bead types (molecules, issues, mail beads) since they all use the same beads system. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
cceacf2b04
commit
81d5b8e75f
@@ -26,7 +26,7 @@ Examples:
|
||||
gt unsling greenplace/joe # Clear joe's hook
|
||||
gt unsling gt-abc greenplace/joe # Unsling gt-abc from joe
|
||||
|
||||
The bead's status changes from 'pinned' back to 'open'.
|
||||
The bead's status changes from 'hooked' back to 'open'.
|
||||
|
||||
Related commands:
|
||||
gt sling <bead> # Hook + start (inverse of unsling)
|
||||
@@ -92,14 +92,14 @@ func runUnsling(cmd *cobra.Command, args []string) error {
|
||||
|
||||
b := beads.New(workDir)
|
||||
|
||||
// Find pinned bead for this agent
|
||||
// Find hooked bead for this agent
|
||||
pinnedBeads, err := b.List(beads.ListOptions{
|
||||
Status: beads.StatusPinned,
|
||||
Status: beads.StatusHooked,
|
||||
Assignee: agentID,
|
||||
Priority: -1,
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("checking pinned beads: %w", err)
|
||||
return fmt.Errorf("checking hooked beads: %w", err)
|
||||
}
|
||||
|
||||
if len(pinnedBeads) == 0 {
|
||||
@@ -139,7 +139,7 @@ func runUnsling(cmd *cobra.Command, args []string) error {
|
||||
// Unpin by setting status back to open
|
||||
status := "open"
|
||||
if err := b.Update(pinned.ID, beads.UpdateOptions{Status: &status}); err != nil {
|
||||
return fmt.Errorf("unpinning bead %s: %w", pinned.ID, err)
|
||||
return fmt.Errorf("unhooking bead %s: %w", pinned.ID, err)
|
||||
}
|
||||
|
||||
// Log unhook event
|
||||
|
||||
Reference in New Issue
Block a user