Skip to content

Suppress status messages on stderr when using -o json/yaml#314

Open
davixcky wants to merge 1 commit intofeature-planfrom
fix/suppress-status-messages-json-output
Open

Suppress status messages on stderr when using -o json/yaml#314
davixcky wants to merge 1 commit intofeature-planfrom
fix/suppress-status-messages-json-output

Conversation

@davixcky
Copy link
Copy Markdown
Contributor

@davixcky davixcky commented Apr 6, 2026

Summary

  • Suppress "Tagged plan..." message on stderr in plan compile, plan create, and plan recompile when -o json or -o yaml is used
  • Suppress "Created execution..." message and spinner on stderr in plan run when -o json or -o yaml is used
  • Messages still appear in default (human-readable) output mode

These messages go to stderr (not stdout), so they don't technically break JSON parsing when stdout is piped directly. However, they do break common patterns like command 2>&1 | jq . and add noise when structured output is requested.

Reproduce (before)

$ signadot plan compile -f prompt.txt --tag my-tag -o json 2>&1 | head -5
Tagged plan yhqr1xcswwc2j as "stderr-test-before"
{
  "id": "yhqr1xcswwc2j",
  "spec": {
    "params": [

Reproduce (after)

$ signadot plan compile -f prompt.txt --tag my-tag -o json 2>&1 | head -5
{
  "id": "r2fjrvf59lmd4",
  "spec": {
    "params": [
      {

Test plan

  • plan compile --tag X -o json 2>&1 produces clean JSON (no "Tagged plan..." line)
  • plan compile --tag X (default mode) still shows "Tagged plan..." on stderr
  • Same fix applied to plan create and plan recompile
  • plan run -o json suppresses "Created execution..." and spinner on stderr
  • plan run (default mode) still shows spinner and status messages

🤖 Generated with Claude Code

When structured output formats (JSON/YAML) are requested, skip printing
"Tagged plan..." and "Created execution..." messages that would pollute
stdout and break machine parsing. Also silence the spinner during
polling in non-default output modes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@scott-cotton scott-cotton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(Please be sure that any actual error messages still do go to stderr)

@davixcky
Copy link
Copy Markdown
Contributor Author

davixcky commented Apr 8, 2026

@scott-cotton Introduced Root.StatusMsg(w, msg, args...) helper on the config so all subcommands can call cfg.StatusMsg(log, ...) instead of inline if cfg.OutputFormat == ... guards.

Tested across all plan subcommands (compile, create, run, delete) with -o json, -o yaml, and default:

  • Status messages (e.g. "Tagged plan...", "Created execution...", spinner) are suppressed in json/yaml mode
  • Errors (404s, validation, API failures) always go to stderr regardless of format
  • stdout contains only structured output in json/yaml mode (validated JSON parsing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants