Skip to content

[pull] main from fern-api:main - #910

Merged
pull[bot] merged 4 commits into
code:mainfrom
fern-api:main
Aug 21, 2026
Merged

[pull] main from fern-api:main#910
pull[bot] merged 4 commits into
code:mainfrom
fern-api:main

Conversation

@pull

@pull pull Bot commented Aug 21, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

devin-ai-integration Bot and others added 4 commits August 21, 2026 16:22
Co-authored-by: rishabh.dhadda <rishabh.dhadda@postman.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ed (#17480)

* fix(cli-generator): render API errors once, with the server body parsed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): lift message out of nested detail bodies

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* feat(cli-generator): add --json and --human output shorthands

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): split error advice into help and expose docs_url in JSON

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): keep error.code an HTTP status and clip page-sized bodies

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* chore(cli-generator): clarify 429 reason note in changelog

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): stop repeating the message inside error.details

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): keep usage text out of error.message

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): drop the global --json shorthand and assert wire-test errors on stdout

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(cli-generator): stop fabricating statuses and repeating what the reader already knows

Follow-up to the review of this PR, plus four bugs the review surfaced that
predate it. Every fix was verified against a real generated CLI (ElevenLabs),
not only the fixture.

Error envelope
- `error.code` is always the HTTP status. The `100..=599` filter only rejected
  out-of-range application codes, so `{"code": 200}` on a 500 still won and the
  envelope contradicted its own exit code. The body's code survives in `details`.
- The lifted message is removed from `details` by path, not by value. A body
  whose second entry carried the same sentence as the first lost it entirely —
  the common multi-field validation shape, where it left problems unattributable
  to their `loc`.
- Only clap's own blocks are split into message/help/usage. Applied to a
  validator's multi-line message it demoted the violations to `help` and left
  the bare header in `message`.
- Non-JSON bodies are summarised rather than pasted in. A short HTML page is
  still multi-line markup, so the old byte-count clip never fired on it; the
  bytes move to `details.body`. Empty bodies and bare JSON strings/lists now
  yield a sentence instead of `""` or a status summary.
- `--format jsonl` emits one line. NDJSON exists to be read a line at a time and
  a pretty-printed envelope put a bare `{` on the first one.

Terminal output
- The parsed body is rendered under the message, so a field-level failure names
  the field instead of hiding the `loc` in an envelope the reader cannot see.
- Lines repeating the message, the reason, or an earlier line are dropped, and a
  sole wrapper object no longer prefixes every line. ElevenLabs echoes one token
  as `code`, `status` and `type`, turning a one-fact 404 into five lines.
- A service-specific reason appears on the message line; one derived from the
  status stays hidden.

Auth
- A credential that cannot be read is no longer indistinguishable from one that
  was never stored. A denied keychain made the CLI send the request anonymously
  and surface whatever the API says to a stranger. Probing paths still degrade.
- The "no credentials" hint fires on any failed status, not just 401/403. An API
  that answers 404 for an anonymous principal said nothing about `auth login`.
  This only annotates: the server, not the spec, decides whether auth was needed.
- "Check for shadowing" appears only with two or more sources, since one source
  cannot shadow anything.
- Credential hints no longer render a literal `<bin>` placeholder.

Transport and dispatch
- Failures that never reached a server report `networkError` with no `code`,
  instead of a fabricated 500 that invited a retry against an uncontacted host.
  The `source()` chain is walked so "Connection refused" survives.
- A request that fails to build (a malformed `--base-url`) is a validation error,
  not an internal one.
- `auth status` honors the global `--format`; `--json` stays as an alias.
- `--help` with an explicit machine format emits the operation catalog, as the
  generated README has always documented. The piped default does not trigger it,
  so `--help | less` still shows help, and a path with no catalog entry falls
  back to prose rather than erroring.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(cli-generator): drop the dead print_error_json wrapper

`print_error_json` wrote the JSON envelope to stdout unconditionally — a
working copy of the double-output bug this release removes, left reachable
under a name someone would reasonably reach for. Nothing called it: not the
runtime, not the generator's emitted code, not any generated CLI. The only
reference was its own no-panic test, which now drives `write_error_json` into
a buffer instead of the real stdout and covers `Network` and `RawSentinel`,
which it previously predated.

Also fixes the intra-doc link on `write_error_json`, which still pointed at
`ErrorDisplayContext::machine_readable` after that field became `format`.
Unresolved rustdoc links in the crate go 17 -> 16; the remaining 16 are
pre-existing and in files this PR does not touch.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: rishabh.dhadda <rishabh.dhadda@postman.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
@pull pull Bot locked and limited conversation to collaborators Aug 21, 2026
@pull pull Bot added the ⤵️ pull label Aug 21, 2026
@pull
pull Bot merged commit 6a81c0e into code:main Aug 21, 2026
9 of 10 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants