Repository navigation
fix(mcp): emit portable Unicode NUL patterns - #1230
Conversation
Preserve NUL rejection while avoiding the short escape rejected by strict schema consumers. Guard the entire advertised input/output catalog and all three JavaScript regexp modes. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed 11c44de. The canonical validators keep their accepted inputs; only NUL representation changes. The catalog regression fails on the base and passes after the fix, and actual stdio tools/list contains 139 tools / 988 patterns with no short NUL escapes or JS compilation failures. Focused tests (110), docs and required CI pass. Actual DeepSeek endpoint replay remains unverified, as stated in the PR.
Preserve NUL rejection while avoiding the short escape rejected by strict schema consumers. Guard the entire advertised input/output catalog and all three JavaScript regexp modes. Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
Summary
Strict schema consumers reject the short NUL escape emitted by REA, so enabling its MCP tools can prevent ordinary chat before any tool runs. Emit
\u0000instead, retaining the existing NUL rejection. This completes the NUL portion of the supplied DeepSeek Harness report alongside the character-class fix merged in #1220.Fixes #1212.
Problem and expected behavior
The reported first rejection is
analyze_javascript_applicationwith pattern^[^\0]*$. V8 accepts this in all modes, so a compilation-only guard misses it. The complete advertised catalog must avoid that short escape while continuing to reject NUL in paths, arguments, symbols and environment entries.Change and scope
Nine regex literals in six canonical schema files use the equivalent Unicode escape. The existing SDK boundary guard also checks NUL representation and compiles every input/output pattern in default,
uandvmodes.Contract and boundary impact
Evidence and regression coverage
f4c99ab8, identifying 41 short-NUL pattern fields.initializeandtools/listexposes 139 tools and 988 input/output pattern fields; zero short-NUL escapes and zero compilation failures in all three JS modes.{"pattern":"^[^\\u0000]*$"}.Validation performed
npm run build:cached— passed.npm run test:focused -- src/contracts/toolInputReferences.test.ts src/contracts/toolOutputReferences.test.ts src/domain/inputIssueProjection.test.ts src/domain/apple/dylibResolution.test.ts tests/boundary/mcp/advertisedPatternsVMode.test.ts tests/boundary/mcp/nativeCallObservationMcp.test.ts— 110 passed.npm run docs:check— passed.npm run check:fast— passed.Compatibility, safety, and release
Review checklist