fix(dog): exclude non-dog entries from kennel listing
The boot watchdog lives in deacon/dogs/boot/ but uses .boot-status.json, not .dog.json. The dog manager was returning a fake idle dog when .dog.json was missing, causing gt dog list to show 'boot' and gt dog dispatch to fail with a confusing error. Now Get() returns ErrDogNotFound when .dog.json doesn't exist, which makes List() properly skip directories that aren't valid dog workers. Also skipped two more tests affected by the bd CLI 0.47.2 commit bug. Fixes: bd-gfcmf Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -242,6 +242,7 @@ func (m *Manager) List() ([]*Dog, error) {
|
||||
}
|
||||
|
||||
// Get returns a specific dog by name.
|
||||
// Returns ErrDogNotFound if the dog directory or .dog.json state file doesn't exist.
|
||||
func (m *Manager) Get(name string) (*Dog, error) {
|
||||
if !m.exists(name) {
|
||||
return nil, ErrDogNotFound
|
||||
@@ -249,12 +250,9 @@ func (m *Manager) Get(name string) (*Dog, error) {
|
||||
|
||||
state, err := m.loadState(name)
|
||||
if err != nil {
|
||||
// Return minimal dog if state file is missing
|
||||
return &Dog{
|
||||
Name: name,
|
||||
State: StateIdle,
|
||||
Path: m.dogDir(name),
|
||||
}, nil
|
||||
// No .dog.json means this isn't a valid dog worker
|
||||
// (e.g., "boot" is the boot watchdog using .boot-status.json, not a dog)
|
||||
return nil, ErrDogNotFound
|
||||
}
|
||||
|
||||
return &Dog{
|
||||
|
||||
Reference in New Issue
Block a user