Skip to content

fix(scripts): preserve emoji in request log previews#109481

Merged
steipete merged 6 commits into
openclaw:mainfrom
Leon-SK668:fix/mock-openai-http-preview-utf16-20260717
Jul 17, 2026
Merged

fix(scripts): preserve emoji in request log previews#109481
steipete merged 6 commits into
openclaw:mainfrom
Leon-SK668:fix/mock-openai-http-preview-utf16-20260717

Conversation

@Leon-SK668

@Leon-SK668 Leon-SK668 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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.
  • The regression test places an emoji exactly across the 4096-character boundary and verifies the preview drops the split character.
  • The initial CI failure in check-sqlite-session-flip-proof was traced to an unavailable workspace package import; the follow-up removes that runtime dependency and awaits the rerun.
  • oxfmt and git diff --check passed.
  • Fresh post-fix autoreview: clean, no actionable findings.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Jul 17, 2026
@steipete
steipete merged commit 1f5c823 into openclaw:main Jul 17, 2026
100 checks passed
@steipete

Copy link
Copy Markdown
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scripts Repository scripts size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants