Skip to content

fix: keep API error output on stderr#33

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/error-output-stderr
Open

fix: keep API error output on stderr#33
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/error-output-stderr

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • write formatted API error bodies to stderr alongside the HTTP status line
  • fall back to JSON for --format-error explore, since the interactive explorer writes to stdout
  • add an end-to-end regression test that keeps stdout empty on API failures

Why

API failures currently split their output across streams: the status line goes to stderr, while the structured response body defaults to stdout. This makes failed commands unsafe to pipe because error JSON can be mistaken for successful output.

Test plan

  • ./scripts/test
  • regression test covers exit status, empty stdout, and the status plus JSON body on stderr

@fallintoplace
fallintoplace requested a review from a team as a code owner July 16, 2026 15:01
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.

1 participant