fix(codex): use truncateUtf16Safe for tool transcript output truncation#102522
Conversation
Replace naive .slice(0, N) with truncateUtf16Safe() in event-projector tool transcript output text to prevent surrogate pair splitting. Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 4:00 AM ET / 08:00 UTC. Summary PR surface: Source +1. Total +1 across 1 file. Reproducibility: yes. from source inspection: a command output delta can be capped by Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the PR open for a narrow revision that imports through the plugin SDK, makes both final and streamed transcript truncation surrogate-safe, adds regression coverage, and includes redacted real-run proof. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: a command output delta can be capped by Is this the best way to solve the issue? No. The proposed change is only a partial fix because it handles the final truncation branch but not the streamed output accumulator that can create and preserve the split surrogate first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 18b24edea627. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1. Total +1 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@steipete this is the same pattern as the recently-merged #102500 (MCP metadata UTF-16) and #102464/#102467 (UTF-16 truncation). The fix applies truncateUtf16Safe to tool transcript output in the codex event-projector. Proof shows the surrogate pair boundary is preserved. Could you take a look when you have a moment? |
|
Land-ready maintainer verification at exact head
The helper import uses the supported plugin-SDK facade; no protocol/config/docs surface changed. |
|
Merged via squash.
|
…on (openclaw#102522) * fix(codex): use truncateUtf16Safe for tool transcript output truncation Replace naive .slice(0, N) with truncateUtf16Safe() in event-projector tool transcript output text to prevent surrogate pair splitting. Co-Authored-By: Claude <[email protected]> * fix(codex): keep streamed output utf16-safe * refactor(codex): use plugin sdk text runtime --------- Co-authored-by: Claude <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Event projector truncates tool transcript output with naive .slice(0, TOOL_TRANSCRIPT_OUTPUT_MAX_CHARS), risking surrogate pair splitting in transcript text shown to users.
Why This Change Was Made
Replace with truncateUtf16Safe(). Same pattern as #102464, #102467, #102500, #102512 (all merged by steipete).
Evidence
Files Changed
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]