Skip to content

fix(cli): render Gateway validation JSON failures - #129043

Merged
steipete merged 1 commit into
mainfrom
autoqa30-gateway-query-json
Aug 25, 2026
Merged

steipete merged 1 commit into
mainfrom
autoqa30-gateway-query-json

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway query commands returned exit code 1 with empty stdout for ordinary command-owned validation failures because their JSON handler only recognized specialized Gateway errors.

Fixes #129042.

Why This Change Was Made

runGatewayCommand preserves the existing authentication, client-request, and transport formatters in their current precedence, then uses the canonical CLI failure envelope as the final fallback for ordinary errors. Human output, specialized payload shapes, Gateway methods/parameters/authentication, and exit behavior remain unchanged.

Production delta: +8/-9, net -1 line. Tests: +180/-11, net +169 lines.

User Impact

Invalid Gateway query arguments now produce parseable JSON instead of empty stdout, while established Gateway-specific error payloads remain compatible.

Evidence

  • Pre-fix owner and built-process regressions reproduced empty stdout without opening a Gateway connection.
  • Focused owner/sibling proof: 81 tests passed.
  • Built-process proof: nine JSON/human/Commander/dual-TTY/local-validation/specialized-auth cases passed.
  • CLI startup build and complete changed-file gates passed.
  • Fresh final P1 autoreview: no actionable findings.
  • git diff --check: passed.

Route-first Gateway health configuration failures are tracked separately in task #101.

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@steipete
steipete marked this pull request as ready for review August 25, 2026 06:18
@steipete steipete self-assigned this Aug 25, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for head 88a1185b2950f07ecad860a7295f32af123abd68:

  • Root cause: Gateway JSON handling recognized only specialized auth/request/transport errors; ordinary validation fell through to stderr+exit with empty stdout.
  • Canonical repair: preserve those specialized formatters in order, then use formatCliJsonFailure as the final fallback.
  • Production: +8/-9, net -1 line. Tests: +180/-11.
  • Focused owner/sibling proof: 81 tests passed.
  • Built-process proof: nine local validation, human/JSON, Commander, dual-TTY, no-state, and specialized-auth cases passed.
  • CLI startup build and complete changed-file gates passed.
  • Final P1 autoreview: no actionable findings, correctness 0.98.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/32816425330 — green.
  • Native review artifacts: validated with zero findings and READY FOR /prepare-pr.

Route-first Gateway health configuration failures are tracked separately in task #101.

@steipete
steipete merged commit 6335d97 into main Aug 25, 2026
233 checks passed
@steipete
steipete deleted the autoqa30-gateway-query-json branch August 25, 2026 06:29
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

cli CLI command changes maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway query validation failures emit empty JSON stdout

1 participant