Fix gt sling code review issues (gt-z9qoo)

- Fix hook location for remote targets using tmux.GetPaneWorkDir()
- Add --var/--on conflict error check
- Add warning for JSON parse fallback (not yet fatal)
- Capture stderr for wisp command
- Remove dead code: detectAgentIdentity(), detectAgentIdentityForHook(),
  detectCloneRootForHook()
- Extract resolveSelfTarget() helper to reduce role-switching duplication

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-25 22:45:21 -08:00
parent 954457731d
commit f7d7f27d92
3 changed files with 69 additions and 194 deletions

View File

@@ -494,18 +494,12 @@ func hookBeadForHandoff(beadID string) error {
return fmt.Errorf("bead '%s' not found", beadID)
}
// Determine agent identity
agentID, err := detectAgentIdentity()
// Determine agent identity and clone root
agentID, _, cloneRoot, err := resolveSelfTarget()
if err != nil {
return fmt.Errorf("detecting agent identity: %w", err)
}
// Get clone root for wisp storage
cloneRoot, err := detectCloneRoot()
if err != nil {
return fmt.Errorf("detecting clone root: %w", err)
}
// Create the slung work wisp
sw := wisp.NewSlungWork(beadID, agentID)
sw.Subject = handoffSubject