Track spawned dogs in DogDispatchInfo (gt-fzkjj)
Set Spawned=true when DispatchToDog creates a new dog, allowing callers to distinguish between reusing an existing dog vs spawning. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
4a22e621a9
commit
dba5f688b9
@@ -940,6 +940,7 @@ func DispatchToDog(dogName string, create bool) (*DogDispatchInfo, error) {
|
|||||||
mgr := dog.NewManager(townRoot, rigsConfig)
|
mgr := dog.NewManager(townRoot, rigsConfig)
|
||||||
|
|
||||||
var targetDog *dog.Dog
|
var targetDog *dog.Dog
|
||||||
|
var spawned bool
|
||||||
|
|
||||||
if dogName != "" {
|
if dogName != "" {
|
||||||
// Specific dog requested
|
// Specific dog requested
|
||||||
@@ -952,6 +953,7 @@ func DispatchToDog(dogName string, create bool) (*DogDispatchInfo, error) {
|
|||||||
return nil, fmt.Errorf("creating dog %s: %w", dogName, err)
|
return nil, fmt.Errorf("creating dog %s: %w", dogName, err)
|
||||||
}
|
}
|
||||||
fmt.Printf("✓ Created dog %s\n", dogName)
|
fmt.Printf("✓ Created dog %s\n", dogName)
|
||||||
|
spawned = true
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("dog %s not found (use --create to add)", dogName)
|
return nil, fmt.Errorf("dog %s not found (use --create to add)", dogName)
|
||||||
}
|
}
|
||||||
@@ -972,6 +974,7 @@ func DispatchToDog(dogName string, create bool) (*DogDispatchInfo, error) {
|
|||||||
return nil, fmt.Errorf("creating dog %s: %w", newName, err)
|
return nil, fmt.Errorf("creating dog %s: %w", newName, err)
|
||||||
}
|
}
|
||||||
fmt.Printf("✓ Created dog %s (pool was empty)\n", newName)
|
fmt.Printf("✓ Created dog %s (pool was empty)\n", newName)
|
||||||
|
spawned = true
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("no idle dogs available (use --create to add)")
|
return nil, fmt.Errorf("no idle dogs available (use --create to add)")
|
||||||
}
|
}
|
||||||
@@ -999,7 +1002,7 @@ func DispatchToDog(dogName string, create bool) (*DogDispatchInfo, error) {
|
|||||||
DogName: targetDog.Name,
|
DogName: targetDog.Name,
|
||||||
AgentID: agentID,
|
AgentID: agentID,
|
||||||
Pane: pane,
|
Pane: pane,
|
||||||
Spawned: false, // TODO: track if we spawned a new session
|
Spawned: spawned,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user