fix(sling): set attached_molecule field when bonding formula to bead (#451)

When using `gt sling <formula> --on <bead>`, the wisp was bonded to the
target bead but the attached_molecule field wasn't being set in the
bead's description. This caused `gt hook` to report "No molecule
attached" even though the formula was correctly bonded.

Now both sling.go (--on mode) and sling_formula.go (standalone formula)
call storeAttachedMoleculeInBead() to record the molecule attachment
after wisp creation. This ensures gt hook can properly display molecule
progress.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Julian Knutsen
2026-01-16 19:41:05 +00:00
committed by GitHub
parent e5aea04fa1
commit 7e158cddd6
4 changed files with 220 additions and 0 deletions

View File

@@ -210,6 +210,13 @@ func runSlingFormula(args []string) error {
fmt.Printf("%s Wisp created: %s\n", style.Bold.Render("✓"), wispRootID)
// Record the attached molecule in the wisp's description.
// This is required for gt hook to recognize the molecule attachment.
if err := storeAttachedMoleculeInBead(wispRootID, wispRootID); err != nil {
// Warn but don't fail - polecat can still work through steps
fmt.Printf("%s Could not store attached_molecule: %v\n", style.Dim.Render("Warning:"), err)
}
// Step 3: Hook the wisp bead using bd update.
// See: https://github.com/steveyegge/gastown/issues/148
hookCmd := exec.Command("bd", "--no-daemon", "update", wispRootID, "--status=hooked", "--assignee="+targetAgent)