fix(status): add -a/--agent and -c/--cloud filter flags to spawn status (#2379)

`spawn status` silently ignored -a and -c flags, showing all servers
regardless. This is inconsistent with `spawn list` and `spawn delete`
which both support these filters.

- Update `cmdStatus` to accept `agentFilter`/`cloudFilter` options and
  pass them to `filterHistory()`
- Update `dispatchStatusCommand` to parse filter flags using the shared
  `parseListFilters` helper (same as list/delete)
- Document filter flags in help text for `spawn status`
- Bump version to 0.15.27

Fixes #2377

Agent: issue-fixer

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-09 07:10:05 -07:00 committed by GitHub
parent 2074211d13
commit f81ef1da4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 2 deletions

View file

@ -26,6 +26,10 @@ function getHelpUsageSection(): string {
spawn delete Delete a previously spawned server (aliases: rm, destroy, kill)
spawn delete -a <agent> Filter servers by agent
spawn delete -c <cloud> Filter servers by cloud
spawn status Show live state of cloud servers (aliases: ps)
spawn status -a <agent> Filter status by agent (or --agent)
spawn status -c <cloud> Filter status by cloud (or --cloud)
spawn status --prune Remove gone servers from history
spawn last Instantly rerun the most recent spawn (alias: rerun)
spawn matrix Full availability matrix (alias: m)
spawn agents List all agents with descriptions

View file

@ -247,8 +247,10 @@ function renderStatusJson(results: ServerStatusResult[]): void {
// ── Main command ─────────────────────────────────────────────────────────────
export async function cmdStatus(opts: { prune?: boolean; json?: boolean } = {}): Promise<void> {
const records = filterHistory();
export async function cmdStatus(
opts: { prune?: boolean; json?: boolean; agentFilter?: string; cloudFilter?: string } = {},
): Promise<void> {
const records = filterHistory(opts.agentFilter, opts.cloudFilter);
const candidates = records.filter(
(r) => r.connection && !r.connection.deleted && r.connection.cloud && r.connection.cloud !== "local",

View file

@ -586,9 +586,12 @@ async function dispatchStatusCommand(filteredArgs: string[]): Promise<void> {
const args = filteredArgs.slice(1);
const prune = args.includes("--prune");
const json = args.includes("--json");
const { agentFilter, cloudFilter } = parseListFilters(args);
await cmdStatus({
prune,
json,
agentFilter,
cloudFilter,
});
}