fix: show correct hint when spawn delete filter matches nothing (#2456)

The 'create a spawn first' message was shown even when active servers
existed but none matched the filter. Now shows 'Run spawn delete without
filters to see all servers.' for the unmatched-filter case and reserves
the create hint for when no servers exist at all.

Fixes #2454

Agent: code-health

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-10 13:01:01 -07:00 committed by GitHub
parent 3978ff6d4d
commit b4e0f575d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -231,8 +231,10 @@ export async function cmdDelete(agentFilter?: string, cloudFilter?: string): Pro
`${servers.length} active server${servers.length !== 1 ? "s" : ""} found, but none matched your filters.`,
),
);
p.log.info(`Run ${pc.cyan("spawn delete")} without filters to see all servers.`);
} else {
p.log.info(`Run ${pc.cyan("spawn <agent> <cloud>")} to create a spawn first.`);
}
p.log.info(`Run ${pc.cyan("spawn <agent> <cloud>")} to create a spawn first.`);
return;
}