Skip to content

agents list drops versions printed to stderr #546

@ayskobtw-lil

Description

@ayskobtw-lil

Bug

sh1pt agents list --json probes each agent CLI with <binary> --version. Some CLIs print version text to stderr while still exiting 0. The current parser reads result.stdout ?? result.stderr, but an empty stdout string is still defined, so stderr is ignored and the installed agent is reported with an empty version.

Repro

Mock or run an agent command that exits 0 with:

stdout: ""
stderr: "claude 1.2.3\n"

Observed JSON before the fix:

{ "id": "claude", "installed": true, "version": "" }

Expected

When stdout is empty, agents list should fall back to stderr and parse the version:

{ "id": "claude", "installed": true, "version": "1.2.3" }

I have a focused regression test and fix ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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