Repository navigation
server: scrub nul characters from thread titles, notion task text and translations - #195
Merged
Merged
Conversation
… translations Reply-thread default titles, Notion task notification text, text sent to the translation provider and translations sent to clients now show NUL as U+FFFD via displayMessageText. The replacement is one UTF-16 unit, so entity offsets stay valid. Placeholder detection scrubs the stored title too, so titles stored with a raw NUL still classify as defaults.
morajabi
force-pushed
the
claude/server-nul-outward-text
branch
from
December 1, 2026 10:19
0744e98 to
02ee206
Compare
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 finishes a gap left by the 2026-11-06 NUL text fix ("Not covered by the server fix").
displayMessageTextscrubs NUL characters from message text when messages are encoded, but some text left the server through other paths without it:subthreads.ts(both the current and legacy builders).isDefaultReplyThreadTitlescrubs the stored title too, so titles saved earlier with a raw NUL still count as defaults.taskNotificationText.ts).restoreCodeTrailingNewlinescompares against the same scrubbed text.displayMessageTextreplaces NUL with U+FFFD, which has the same UTF-16 length, so entity offsets don't move. It gains astring | nulloverload.Not covered: thread titles a person sets themselves are still not scrubbed when chats are encoded.
Tests
encodeMessage.test.ts: 32 pass.mcpReadCost.test.ts › archive pass stays within its statement budget, which fails the same way on an unrelated branch.typecheck,test:checkandlint:strictare clean.🤖 Generated with Claude Code