Skip to content

feat: export error contract helpers#396

Merged
thymikee merged 1 commit intomainfrom
codex/issue-390-export-errors-contract
Apr 11, 2026
Merged

feat: export error contract helpers#396
thymikee merged 1 commit intomainfrom
codex/issue-390-export-errors-contract

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

Summary

  • Worth it: yes. This makes the daemon error taxonomy and normalization helper available from the contracts layer so consumers do not maintain parallel subsets.
  • Export AppErrorCode, normalizeError, and defaultHintForCode from agent-device/contracts.
  • Rename the internal error-code union to AppErrorCode while keeping normalization and hint behavior unchanged.
  • Keep defaultHintForCode accepting wire string codes for public DaemonError callers.

Touched files: 3. Scope stayed within error contract export surface. Docs/skills were not updated because this is a library API export, not CLI behavior.

Closes #390

Validation

  • pnpm install
  • pnpm format
  • pnpm check:quick

Known gaps: none.

Copy link
Copy Markdown

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

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: 4c3dd06111

ℹ️ 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".

@@ -1,3 +1,6 @@
export type { AppErrorCode } from './utils/errors.ts';
export { defaultHintForCode, normalizeError } from './utils/errors.ts';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid Node-only re-export in contracts entrypoint

Re-exporting normalizeError from agent-device/contracts now forces that module to load src/utils/errors.ts, which in turn imports src/utils/diagnostics.ts and its Node built-ins (node:async_hooks, node:fs, etc.). This breaks consumers that use the contracts entrypoint in non-Node runtimes (browser/edge/worker) with module-resolution errors, whereas this file was explicitly kept dependency-free for bridge/cloud contract validation.

Useful? React with 👍 / 👎.

@thymikee thymikee force-pushed the codex/issue-390-export-errors-contract branch 2 times, most recently from 982b65c to b3960a5 Compare April 11, 2026 18:09
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 11, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-396/

Built to branch gh-pages at 2026-04-11 18:13 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@thymikee thymikee force-pushed the codex/issue-390-export-errors-contract branch from b3960a5 to c3c23bf Compare April 11, 2026 18:13
@thymikee thymikee merged commit 0fe724f into main Apr 11, 2026
16 checks passed
@thymikee thymikee deleted the codex/issue-390-export-errors-contract branch April 11, 2026 18:14
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.

Export error code union and normalizeError

1 participant