[WRONG BRANCH] fix(openai): bound Unicode pattern schema traversal allocations - #475
[WRONG BRANCH] fix(openai): bound Unicode pattern schema traversal allocations#475luvs01 wants to merge 1 commit into
Conversation
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. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Its title has been prefixed with |
Motivation
patternsanitizer that could amplify attacker-controlled schema sizes into large transient allocations.\p{…}/\P{…}scalarpatternconstraints for Python-rebackends while leaving other schema semantics intact.Description
stripUnicodePropertyPatternsso containers and sibling entries are not cloned unless an incompatiblepatternis removed.Object.entries()materialization and per-child closure allocations by streaming object entries and cloning only the ancestor path(s) that must change; array and name-bag semantics are preserved.PRESERVED_PATTERN_SUBTREES, literal-value keys, and the encrypted-marker semantics so behavior for protected subtrees and literal payloads is unchanged.tests/adapters/openai/openai-chat-hardening.test.tsthat verifies broad schemas only clone affected paths while unchanged siblings retain identity.Testing
./node_modules/bun/bin/bun.exe test tests/adapters/openai/openai-chat-hardening.test.tsand it passed (focused tests covering the sanitizer passed)../node_modules/bun/bin/bun.exe test tests/responses/openai-responses-passthrough.test.tsand it passed (sanitization integration checks passed)../node_modules/bun/bin/bun.exe x tsc --noEmitand./node_modules/bun/bin/bun.exe run privacy:scanwhich both succeeded../node_modules/bun/bin/bun.exe run testrun encountered a Bun parallel-worker panic and unrelated test failures in other suites during the repository-wide run; the focused and relevant test suites for this change succeeded.Codex Task