From 52e9b4840063dfd24c859b57bd827623bb63bf76 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Mon, 29 Dec 2025 14:05:20 -0800 Subject: [PATCH] feat: Add slot fields to Issue struct and set role slot on create MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add HookBead and RoleBead fields to Issue struct for JSON unmarshal - CreateAgentBead now calls bd slot set to set role slot properly - This ensures role_bead is stored as a first-class field, not just embedded in description text 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- internal/beads/beads.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/beads/beads.go b/internal/beads/beads.go index 98b04ad6..291b8085 100644 --- a/internal/beads/beads.go +++ b/internal/beads/beads.go @@ -78,6 +78,10 @@ type Issue struct { Blocks []string `json:"blocks,omitempty"` BlockedBy []string `json:"blocked_by,omitempty"` + // Agent bead slots (type=agent only) + HookBead string `json:"hook_bead,omitempty"` // Current work attached to agent's hook + RoleBead string `json:"role_bead,omitempty"` // Role definition bead (shared) + // Counts from list output DependencyCount int `json:"dependency_count,omitempty"` DependentCount int `json:"dependent_count,omitempty"` @@ -624,6 +628,14 @@ func (b *Beads) CreateAgentBead(id, title string, fields *AgentFields) (*Issue, return nil, fmt.Errorf("parsing bd create output: %w", err) } + // Set the role slot if specified (this is the authoritative storage) + if fields != nil && fields.RoleBead != "" { + if _, err := b.run("slot", "set", id, "role", fields.RoleBead); err != nil { + // Non-fatal: warn but continue + fmt.Printf("Warning: could not set role slot: %v\n", err) + } + } + return &issue, nil }