Skip to content

feat(cli): print request IDs, log links and doc URLs on errors - #12

Merged
purpshell merged 2 commits into
devfrom
codex/error-bodies
Sep 23, 2026
Merged

purpshell merged 2 commits into
devfrom
codex/error-bodies

Conversation

@purpshell

@purpshell purpshell commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Summary

API failures now include the request log and documentation links returned by the API.

  • Human stderr prints Error:, followed by Request ID:, Request log:, and Docs: when those values exist.
  • The --json error envelope keeps schemaVersion: 1 and adds optional error.requestLogUrl and error.docUrl fields.
  • Both URL fields pass through registered-secret redaction before human or JSON output.
  • The pinned SDK reads the request ID from the error body before falling back to headers, preserves the error code, and classifies HTTP 413 as validation (CLI exit 2). Absent links remain absent.

The SDK dependency is the published npm version @polymorfa/sdk@0.1.0-dev.20260922102711, pinned in both package.json and package-lock.json. The previous unmerged SDK Git pin is no longer the dependency. The API error-body work is tracked in polymorfa/polymorfa#198; this CLI change does not establish its deployed availability.

Six-part assessment

Part Status Evidence or remaining work
API Unaffected in this PR Consumes the existing error object fields error.code, error.request_id, error.request_log_url, and top-level docs. No route, credential authority, scope, or server behavior changes here. Live deployment of the corresponding API behavior was not exercised.
SDKs Unaffected implementation; dependency verified The rebased CLI already pins npm 0.1.0-dev.20260922102711; this PR does not change the dependency manifest. Its installed transport confirms body-first request IDs, link parsing, and HTTP 413 classification.
CLI Updated Error presentation, redaction, human stderr rendering, and optional JSON fields are updated. Command flags and the existing category-to-exit-code mapping are unchanged.
Docs Updated locally; publication blocked on CLI release README.md documents output fields. Prepared internal launch copy adds CLI human/JSON output and redaction behavior to monorepo docs/api/errors.mdx. Publish that copy alongside the CLI release; date any changelog entry for confirmed availability.
Feature releases Unaffected controls; release acceptance pending The CLI remains unpublished. No new flag, entitlement, or enrollment. The additional lines are omitted when the API does not supply them. npm dependency availability does not establish CLI publication or deployed API support.
Admin controls Unaffected Only customer CLI error rendering changes. There is no new durable state or staff action, and request-log links retain the Console's membership checks.

Verification

Verified CLI head: 009f42a266f590233f063c6e9b111e925b040bf6.

  • Exact-head CI completed successfully. The checked-in workflow runs npm ci and npm run verify on Node 22; verify includes formatting, lint, typecheck, tests, build, package dry-run, and production dependency audit.

  • Independent exact-head archive: offline dependency installation, build, and 23 focused error/API tests passed on Node 24.15.0.

  • Focused assertions cover optional request/log/docs values, message-only output, and registered-secret redaction in both new URL fields. The command catch path supplies the registered secrets to the shared presenter before rendering human and JSON output.

  • Prepared error documentation examples exactly match the compiled presenter and JSON envelope at this head.

Not exercised: a live API deployment returning these fields or an installed released CLI. Publishing the prepared customer documentation alongside the CLI release and completing live release acceptance remain outstanding.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 50cc3a08-81f9-40b3-b55d-1d3170d1e0b0

📥 Commits

Reviewing files that changed from the base of the PR and between 0895876 and 009f42a.

📒 Files selected for processing (5)
  • README.md
  • src/base-command.ts
  • src/errors/present.ts
  • src/output/contracts.ts
  • test/errors/present.test.ts

Comment @coderabbitai help to get the list of available commands.

@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-22T11:46:17.448432Z 009f42a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d9057cea6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/errors/present.ts Resolved
@purpshell

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 009f42a266

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@purpshell
purpshell marked this pull request as ready for review September 23, 2026 09:27
@purpshell
purpshell merged commit bb817ac into dev Sep 23, 2026
3 checks passed
@purpshell
purpshell deleted the codex/error-bodies branch October 26, 2026 15:52
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