Repository navigation
fix(schema): strip null bytes from ParamReason - #1326
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Corrected and pushed 7a52384. The original transform ran after min(1), allowing a NUL-only reason to become empty, and changed generated-schema ordering without updating definitions (the failing CI step). Using Zod overwrite before trim/min preserves the input JSON schema and validates the sanitized value. Added NUL-only/whitespace regression coverage. All 31 update-issue tests, check:generated, and the full repository tsc/lint/test gate pass locally. Awaiting the new head's CI checks.
BYK
added a commit
that referenced
this pull request
Sep 30, 2026
Pulls in the synchronous output fd release from [BYK/binpatch#37](BYK/binpatch#37) — `applyReaderToFile` now closes the output fd via `fs.closeSync` before returning, eliminating the ETXTBSY race that broke the delta-upgrade → full-download fallback on Linux. Verified locally: - `pnpm --filter sentry run typecheck` — clean - `pnpm --filter sentry run test:unit` — 8754 passed | 15 skipped Also depends on [BYK/binpatch#38](BYK/binpatch#38) (adds the github target to .craft.yml — internal change, no runtime impact).
mr-danya
pushed a commit
to mr-danya/sentry-mcp
that referenced
this pull request
Oct 6, 2026
Pulls in the synchronous output fd release from [BYK/binpatch#37](BYK/binpatch#37) — `applyReaderToFile` now closes the output fd via `fs.closeSync` before returning, eliminating the ETXTBSY race that broke the delta-upgrade → full-download fallback on Linux. Verified locally: - `pnpm --filter sentry run typecheck` — clean - `pnpm --filter sentry run test:unit` — 8754 passed | 15 skipped Also depends on [BYK/binpatch#38](BYK/binpatch#38) (adds the github target to .craft.yml — internal change, no runtime impact).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an
ApiValidationErrorthat occurs when AI clients provide areasonstring containing null (\0) bytes. The Sentry API rejects comments with null characters, leading to aBad Requesterror.The root cause was identified as the
ParamReasonZod schema inpackages/mcp-core/src/schema.tsnot stripping these null bytes. The schema only trimmed whitespace and enforced a minimum length, allowing\0characters to pass through to the Sentry API.Changes Made:
.transform((s) => s.replace(/\0/g, ""))to theParamReasonZod definition inpackages/mcp-core/src/schema.ts. This ensures that any null bytes are removed from thereasonstring before it is used in API calls.packages/mcp-core/src/tools/catalog/update-issue.test.tsto verify thatprepareToolParams(which uses the Zod schema) correctly strips null bytes from thereasonparameter.Fixes MCP-SERVER-FYA
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.