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).
Found while fixing the same defect class in the three
os datasourcesubcommands (#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.tsbuilds its failure text fromparsed?.erroras if it were a string, in both of its request helpers:In the declared envelope (
packages/types/src/response-envelope.ts)erroris an object —{ code, message }— soString(errMsg)is"[object Object]". No crash (unlike thethis.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.
origin/main@58563be0: both helpers (postJson~:646,postBinary~:691) carry the identicalconst errMsg = parsed?.error ?? …; error: String(errMsg)pair.{ code, message }envelope on every failure path, or whether some paths still answer a flat stringerror— i.e. whether the fix is the os datasource list-tables/introspect/validate are non-functional — CLI reads pre-#3843 flat envelope #10675 shape (read the message off the object with a flat-string fallback) or a strict envelope read that treats a flat string as a contract violation. Existing evidence does not rule it: os datasource list-tables/introspect/validate are non-functional — CLI reads pre-#3843 flat envelope #10675 only measured the datasource routes.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).