fix(sling): auto-attach work molecule and handle dead polecats

Combines three related sling improvements:

1. Auto-attach mol-polecat-work (Issue #288)
   - Automatically attach work molecule when slinging to polecats
   - Ensures polecats have standard guidance molecule attached

2. Fix polecat hook with molecule (Issue #197)
   - Use beads.ResolveHookDir() for correct directory resolution
   - Prevents bd cook from failing in polecat worktree

3. Spawn fresh polecat when target has no session
   - When slinging to a dead polecat, spawn fresh one instead of failing
   - Fixes stale convoys not progressing due to done polecats
This commit is contained in:
mayor
2026-01-13 14:01:49 +01:00
committed by Daniel Sauer
parent 278b2f2d4d
commit 7924921d17
3 changed files with 112 additions and 1 deletions

View File

@@ -111,6 +111,11 @@ func runBatchSling(beadIDs []string, rigName string, townBeadsDir string) error
// Update agent bead state
updateAgentHookBead(targetAgent, beadID, hookWorkDir, townBeadsDir)
// Auto-attach mol-polecat-work molecule to polecat agent bead
if err := attachPolecatWorkMolecule(targetAgent, hookWorkDir, townRoot); err != nil {
fmt.Printf(" %s Could not attach work molecule: %v\n", style.Dim.Render("Warning:"), err)
}
// Store args if provided
if slingArgs != "" {
if err := storeArgsInBead(beadID, slingArgs); err != nil {