Skip to content

ref(core): Replace ad hoc record guards with schemas - #1153

Merged
dcramer merged 2 commits into
mainfrom
codex/refactor-record-validation
Jul 11, 2026
Merged

dcramer merged 2 commits into
mainfrom
codex/refactor-record-validation

Conversation

@dcramer

@dcramer dcramer commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Unknown API, replay, and tool-result payloads now cross explicit Zod schemas, while generic object inspection is limited to formatting code that genuinely accepts arbitrary records.

Events validation and trace-item attribute schemas match the required fields emitted by the current Sentry source instead of fabricating defaults for impossible response shapes. Replay recordings remain selectively parsed because the upstream endpoint intentionally exposes arbitrary RRWeb dictionaries. The related mocks and regression fixtures now use those source-backed contracts.

Logging also accepts one typed options object, and the OAuth callback records only state-presence booleans rather than raw CSRF state values.

Use typed logging options for internal callers and validate unknown API and tool payloads at their boundaries. Preserve the existing tolerant behavior for partially malformed response data while removing duplicated generic record guards.

Co-Authored-By: Codex CLI Agent <noreply@openai.com>
Comment thread packages/mcp-core/src/api-client/client.ts
Model events validation and trace attribute responses from the current
Sentry endpoint types instead of recovering from impossible malformed
shapes. Update mocks and regression fixtures to match those contracts,
and avoid recording raw OAuth state values while fixing typed logging.

Co-Authored-By: Codex CLI Agent <noreply@openai.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b828368. Configure here.

Comment thread packages/mcp-core/src/api-client/client.ts
Comment thread packages/mcp-core/src/api-client/client.ts
@dcramer
dcramer merged commit ce099fd into main Jul 11, 2026
22 checks passed
@dcramer
dcramer deleted the codex/refactor-record-validation branch July 11, 2026 00:52

This branch was previously deployed

1 inactive deployment
Actions — b828368e Deployed Jul 10, 2026 by dcramer via eval #1053
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