Skip to content

ux(pause): JSON error responses from pause/resume missing command field #885

@agents-squads

Description

@agents-squads

Problem

squads pause and squads resume return inconsistent JSON error shapes. Agents parsing CLI output in --json mode break because the error shape lacks the command field present in all other commands.

Success shape (correct):

{ "ok": true, "command": "pause", "data": { ... } }

Error shape (missing command):

{ "ok": false, "error": "Squad \"nonexistent\" not found" }

Compare with squads status --json (correct error shape):

{ "ok": false, "command": "status", "error": "Squad \"nonexistent\" not found" }

Agents that route JSON output by command field will fail to identify the source command when errors occur.

Where

src/commands/pause.ts — all error branches in both pauseSquad() and resumeSquad():

// line ~24, ~35:
console.log(JSON.stringify({ ok: false, error: 'No .agents/squads directory found' }));
console.log(JSON.stringify({ ok: false, error: `Squad "${squadName}" not found` }));

Fix

Add command field to all error responses:

// In pauseSquad:
console.log(JSON.stringify({ ok: false, command: 'pause', error: 'No .agents/squads directory found' }));
console.log(JSON.stringify({ ok: false, command: 'pause', error: `Squad "${squadName}" not found` }));

// In resumeSquad:
console.log(JSON.stringify({ ok: false, command: 'resume', error: 'No .agents/squads directory found' }));
console.log(JSON.stringify({ ok: false, command: 'resume', error: `Squad "${squadName}" not found` }));

Labels

type:ux, priority:P2, squad:cli, source:ux-eval

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions