From 42f4f0555f8ac93dbe28b6d8e901ad80d7d35e8f Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Fri, 26 Dec 2025 16:20:26 -0800 Subject: [PATCH] park.go: Replace ReadHook with pinned bead query (gt-rgd9x.1) --- internal/cmd/park.go | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/internal/cmd/park.go b/internal/cmd/park.go index 2ba89d38..7e933ebb 100644 --- a/internal/cmd/park.go +++ b/internal/cmd/park.go @@ -5,12 +5,13 @@ import ( "fmt" "os" "os/exec" + "path/filepath" "strings" "time" "github.com/spf13/cobra" + "github.com/steveyegge/gastown/internal/beads" "github.com/steveyegge/gastown/internal/style" - "github.com/steveyegge/gastown/internal/wisp" ) // Park command parks work on a gate, allowing agent to exit safely. @@ -109,12 +110,25 @@ func runPark(cmd *cobra.Command, args []string) error { return fmt.Errorf("detecting agent identity: %w", err) } - // Read current hook state (if any) + // Read current pinned bead (if any) var beadID, formula, hookContext string - if hook, err := wisp.ReadHook(cloneRoot, agentID); err == nil { - beadID = hook.BeadID - formula = hook.Formula - hookContext = hook.Context + workDir, err := findLocalBeadsDir() + if err == nil { + b := beads.New(workDir) + pinnedBeads, err := b.List(beads.ListOptions{ + Status: beads.StatusPinned, + Assignee: agentID, + Priority: -1, + }) + if err == nil && len(pinnedBeads) > 0 { + beadID = pinnedBeads[0].ID + // Extract molecule from attachment fields + if attachment := beads.ParseAttachmentFields(pinnedBeads[0]); attachment != nil { + formula = attachment.AttachedMolecule + } + // Context is part of the bead description, not stored separately + hookContext = pinnedBeads[0].Description + } } // Build context combining hook context and new message @@ -190,7 +204,7 @@ func runPark(cmd *cobra.Command, args []string) error { // parkedWorkPath returns the file path for an agent's parked work state. func parkedWorkPath(cloneRoot, agentID string) string { - return wisp.WispPath(cloneRoot, fmt.Sprintf("parked-%s.json", strings.ReplaceAll(agentID, "/", "_"))) + return filepath.Join(cloneRoot, ".beads", fmt.Sprintf("parked-%s.json", strings.ReplaceAll(agentID, "/", "_"))) } // readParkedWork reads the parked work state for an agent.