fix(scripts): preserve emoji in request log previews#109481
Merged
steipete merged 6 commits intoJul 17, 2026
Merged
Conversation
Co-authored-by: Leon-SK668 <[email protected]>
Co-authored-by: Leon-SK668 <[email protected]>
Co-authored-by: Leon-SK668 <[email protected]>
Contributor
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 17, 2026
* fix(scripts): preserve emoji in request log previews * fix(scripts): keep mock preview standalone * refactor(scripts): reuse UTF-16 truncation helper Co-authored-by: Leon-SK668 <[email protected]> * test(scripts): cover raw Node mock loading Co-authored-by: Leon-SK668 <[email protected]> * docs(scripts): note raw Node type stripping contract Co-authored-by: Leon-SK668 <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
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.
What Problem This Solves
Fixes an issue where mock OpenAI E2E request logs could persist malformed Unicode when an oversized external request body placed an emoji across the 4096-character preview boundary.
Why This Change Was Made
The request-log limiter now backs its existing code-unit boundary away from the middle of a surrogate pair while retaining the same character budget, byte-length accounting, and structured truncation marker. The small helper stays local because these mock servers are launched by plain Node before workspace packages are built or linked.
User Impact
Developers can inspect bounded mock OpenAI request logs containing emoji without lone surrogate code units at the preview boundary.
Evidence
node scripts/run-vitest.mjs test/scripts/mock-openai-http.test.ts(6 tests passed)node --input-type=module --eval "await import('./scripts/e2e/lib/mock-openai-http.mjs')"passed on Node 22.22.check-sqlite-session-flip-proofwas traced to an unavailable workspace package import; the follow-up removes that runtime dependency and awaits the rerun.oxfmtandgit diff --checkpassed.