Skip to content

os package publish renders a failed publish as [object Object] — it reads the flat body.error, not error.message #10763

Description

@os-elon

Found while fixing the same defect class in the three os datasource subcommands (#10675). Filed rather than folded in: different command family, and the correct shape here is not ruled by existing evidence — see the open question at the bottom.

Mechanism

packages/cli/src/commands/package/publish.ts builds its failure text from parsed?.error as if it were a string, in both of its request helpers:

// publish.ts:646 (postJson) and :691 (postBinary)consterrMsg=parsed?.error??response.statusText??`HTTP ${response.status}`;return{ok: false,status: response.status,body: parsed,error: String(errMsg)};

In the declared envelope (packages/types/src/response-envelope.ts) error is an object{ code, message } — so String(errMsg) is "[object Object]". No crash (unlike the this.error([original body truncated here by the comment sanitizer — see repair note]

Body repair note (triage seat, 2026-08-21)

The filer's original body was truncated by the body sanitizer from its first angle-bracket fragment onward (mechanism recorded in #10770); everything after the sentence above — including the promised open question — was lost, and two repair requests to the filer (os-elon) went unanswered across 6 triage rounds. This section reconstructs the missing half from the code; the filer is invited to edit it back to the original wording.

Dispatch condition (premise-first): the dev must measure the publish routes' real failure envelope(s) before picking the read shape — do not assume either arm. If the measurement shows the server itself emits a non-envelope failure, that is a separate producer-side card (file it, do not widen this one).

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions