Fix gt sling --naked to bypass pane lookup for terminated polecats

When slinging to an existing polecat with --naked flag, the code was still
attempting to look up the tmux pane, which fails for terminated polecats.
Now resolveTargetAgent accepts a skipPane parameter that bypasses the tmux
pane and working directory lookup when true.

This allows work to be slung to terminated polecats that will be restarted
manually later.

Also updated unsling to skip pane lookup since it only needs the agent ID.

🤖 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-29 22:04:39 -08:00
parent 3f09801939
commit 196c3bbf9b
2 changed files with 16 additions and 6 deletions

View File

@@ -71,7 +71,8 @@ func runUnsling(cmd *cobra.Command, args []string) error {
var agentID string
var err error
if targetAgent != "" {
agentID, _, _, err = resolveTargetAgent(targetAgent)
// Skip pane lookup - unsling only needs agent ID, not tmux session
agentID, _, _, err = resolveTargetAgent(targetAgent, true)
if err != nil {
return fmt.Errorf("resolving target agent: %w", err)
}