fix(sling): allow auto-attach mol-polecat-work on open polecat beads
This commit is contained in:
@@ -158,8 +158,12 @@ func (b *Beads) AttachMolecule(pinnedBeadID, moleculeID string) (*Issue, error)
|
|||||||
return nil, fmt.Errorf("fetching pinned bead: %w", err)
|
return nil, fmt.Errorf("fetching pinned bead: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Allow pinned beads OR open polecat agent beads (polecats have a lifecycle, not permanent)
|
||||||
if issue.Status != StatusPinned {
|
if issue.Status != StatusPinned {
|
||||||
return nil, fmt.Errorf("issue %s is not pinned (status: %s)", pinnedBeadID, issue.Status)
|
_, role, _, ok := ParseAgentBeadID(pinnedBeadID)
|
||||||
|
if !(issue.Status == "open" && ok && role == "polecat") {
|
||||||
|
return nil, fmt.Errorf("issue %s is not pinned or open polecat (status: %s)", pinnedBeadID, issue.Status)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build attachment fields with current timestamp
|
// Build attachment fields with current timestamp
|
||||||
|
|||||||
@@ -508,8 +508,10 @@ func runSling(cmd *cobra.Command, args []string) error {
|
|||||||
updateAgentHookBead(targetAgent, beadID, hookWorkDir, townBeadsDir)
|
updateAgentHookBead(targetAgent, beadID, hookWorkDir, townBeadsDir)
|
||||||
|
|
||||||
// Auto-attach mol-polecat-work to polecat agent beads
|
// Auto-attach mol-polecat-work to polecat agent beads
|
||||||
// This ensures polecats have the standard work molecule attached for guidance
|
// This ensures polecats have the standard work molecule attached for guidance.
|
||||||
if strings.Contains(targetAgent, "/polecats/") {
|
// Only do this for bare beads (no --on formula), since formula-on-bead
|
||||||
|
// mode already attaches the formula as a molecule.
|
||||||
|
if formulaName == "" && strings.Contains(targetAgent, "/polecats/") {
|
||||||
if err := attachPolecatWorkMolecule(targetAgent, hookWorkDir, townRoot); err != nil {
|
if err := attachPolecatWorkMolecule(targetAgent, hookWorkDir, townRoot); err != nil {
|
||||||
// Warn but don't fail - polecat will still work without molecule
|
// Warn but don't fail - polecat will still work without molecule
|
||||||
fmt.Printf("%s Could not attach work molecule: %v\n", style.Dim.Render("Warning:"), err)
|
fmt.Printf("%s Could not attach work molecule: %v\n", style.Dim.Render("Warning:"), err)
|
||||||
|
|||||||
Reference in New Issue
Block a user