You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* cli: reclassify parse/read failures + add source/http_status telemetry
Reclassify the remaining opaque `error` sites: a mid-response read failure ->
network_error; JSON-parse and poll field-extraction failures -> response_parse_error.
Capture the request id from x-amzn-request-id / x-amzn-trace-id (the app does not set
X-Request-Id; the ALB does), falling back to X-Request-Id.
Add telemetry-only origin signals to COMMAND_RUN_COMPLETE: source (api = from the API
envelope, cli = CLI-generated; defaults to cli) and http_status (upstream status when
known). Both are omitted on success and are NOT in the user-facing error envelope.
Dashboards can then group by (source, error_code) collision-safely and separate an
app 5xx from a no-envelope 5xx via source.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* cli: add reserved cli_ prefix + code registry with enforcement test
Namespace the CLI-originated response-parse code as cli_response_parse_error,
add a central registry of all CLI-minted codes, and a test that scans source
and fails on any unregistered or bare-but-not-allowlisted CLI code, forcing the
cli_ prefix on future codes so they can never collide with an API code.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* cli: drop x-amzn request-id fallback from the error envelope
The x-amzn-request-id/trace-id fallback populated request_id, but api_service
does not log those ids, so there is no working server-side correlation path for
a caller to use. Revert to reading only X-Request-Id (which the app doesn't set
today, so request_id stays omitted) rather than surfacing an id nobody can trace.
The request_id envelope field is kept so it populates for free once the backend
sets/logs a real request id.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* cli: catch code:= in the registry scan; correct the envelope-doc bare-code note
Codex nits on the cli_ namespacing: the source-scan regex missed the 'code :='
short-declaration form (a bare CLI code declared that way would evade the
enforcement test), and the README said every bare code carries API semantics,
omitting the grandfathered-legacy-CLI exception.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* cli: address #208 review — http_status on known-status CLI sites, invert cli_ scan, tidy classifyError
- Set HTTPStatus on the CLI-synthesized errors whose status is known: the
mid-body-read network_error and the download url-expired/failed cases, so the
telemetry (source, http_status) axis can tell a 403 from a 404 and a 500 from
a 502 (previously http_status=0 there). Completes the origin-axis design.
- Add an inverted registry scan: any cli_-prefixed string literal in production
source must be a registered code (or an explicit non-code literal like the
cli_version analytics key), closing the identifier-coupling gap where a code
assigned via a non-'code' variable name would evade the Code:/code= scan.
- Move the CLI-origin default into classifyError so main.go's wrapped-error
branch no longer special-cases source.
- Fix an em dash in the cli_download_failed hint.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ Every command supports `--help`.
164
164
| Aspect | Behavior |
165
165
|--------|----------|
166
166
|**stdout**| Always JSON. Even `video download` — binary writes to disk; stdout emits `{"asset", "message", "path"}` so you can chain on `.path`. |
167
-
|**stderr**| Structured envelope on error: `{"error": {"code", "message", "hint", "param", "doc_url", "request_id"}}`. `code`/`message` are always present; `hint`/`param`/`doc_url`/`request_id` appear when applicable (`param`/`doc_url` are surfaced from the API for validation and documented errors). Stable `code` values for programmatic branching. |
167
+
|**stderr**| Structured envelope on error: `{"error": {"code", "message", "hint", "param", "doc_url", "request_id"}}`. `code`/`message` are always present; `hint`/`param`/`doc_url`/`request_id` appear when applicable (`param`/`doc_url` are surfaced from the API for validation and documented errors). Stable `code` values for programmatic branching. A code prefixed `cli_` is originated by the CLI itself (client/transport/local conditions, e.g. `cli_download_url_expired`). A bare code is either an API code (or a CLI mirror of one) or one of a small frozen set of legacy CLI codes that predate the prefix. The `cli_` prefix is reserved for the CLI, so a new CLI code can never collide with an API code. |
168
168
|**Exit codes**|`0` ok · `1` API or network · `2` usage · `3` auth / not permitted · `4` timeout under `--wait` (stdout contains partial resource for resume) |
169
169
|**Request bodies**| Flags for simple inputs; `-d` for nested JSON (inline, file path, or `-` for stdin). Flags override matching fields. |
170
170
|**Async jobs**|`--wait` blocks with exponential backoff; `--timeout` sets max (default 20m). 429s and 5xx retry automatically. |
0 commit comments