Repository navigation
Conversation
|
@jamadeo is on triage rotation this week and is the reviewer for this one. Labels come from the PR labeler. Please review the change. Automated triage. Labels are a first pass and the assigned maintainer has the final say. |
| .then(|| std::str::from_utf8(&file.bytes).ok()) | ||
| .flatten(); | ||
| .flatten() | ||
| .filter(|text| !text.contains('\0')); |
There was a problem hiding this comment.
I went with a NUL check instead of trying to detect the charset from a BOM or XML declaration. We still don't transcode, and readable text shouldn't contain \0, so treating it as a blob is the safer fallback.
d3e926a to
24536b0
Compare
Codex Review Summary: ✅ CompletedThis 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. |
Motivation and Context
Following up on #1409 (review), send a skill file with a textual MIME type as a blob if its contents include a NUL byte. This handles the UTF-16LE XML case.
Files with a textual MIME type are sent as text when their bytes are valid UTF-8. UTF-16 with a BOM already fails this check and is sent as a blob. But UTF-16LE without a BOM can pass, since each ASCII character is followed by
0x00, and NUL is valid UTF-8. As a result, the host receives text interspersed with NULs instead of the original document.How Has This Been Tested?
Added tests
Breaking Changes
None.
Types of changes
Checklist