Skip to content

[BUG] cortex servers --json outputs plain text on errors #1337

@DanielDerefaka

Description

@DanielDerefaka

Project

cortex

Description

When --json is specified, the command still prints human-readable text and errors instead of JSON. This breaks scripting and JSON parsing in error cases.

Error Message

mDNS error: Failed to create mDNS daemon: failed to create signal_sock for daemon: Operation not permitted (os error 1)

Debug Logs

N/A

System Information

OS: Darwin 25.2.0 (arm64)
Cortex version: 0.1.1

Screenshots

No response

Steps to Reproduce

  1. Run cortex servers --json; echo EXIT:$?.
  2. Observe the plain text banner and error output.

Expected Behavior

With --json, output should be valid JSON even on failure.

Actual Behavior

The command prints a plain text banner and error message, then exits with status 1.

Additional Context

The non-JSON banner appears before any error output, making JSON parsing impossible.

Repro output:

Discovering Cortex servers on local network...

Error: mDNS error: Failed to create mDNS daemon: failed to create signal_sock for daemon: Operation not permitted (os error 1)
EXIT:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingvalidValid issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions