fix(codex): avoid broken emoji in dynamic tool timeout logs#102509
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 3:49 AM ET / 07:49 UTC. Summary PR surface: Source +1, Tests +39. Total +40 across 2 files. Reproducibility: yes. source-level reproduction is high confidence: current main uses raw UTF-16 Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow helper reuse once required CI is green or the failing type-check job is understood, keeping the fix limited to timeout diagnostics. Do we have a high-confidence way to reproduce the issue? Yes, source-level reproduction is high confidence: current main uses raw UTF-16 Is this the best way to solve the issue? Yes, this is the best code shape for the reported bug: normalize once at AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 51bb5f684778. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +39. Total +40 across 2 files. 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
|
|
Land-ready maintainer verification at exact head
The timer-driven regression proves process action/session metadata and returned timeout text contain no dangling surrogate. |
|
Merged via squash.
|
…#102509) * fix(codex): keep dynamic tool log fields UTF-16 safe * test(codex): narrow dynamic tool response item --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where Codex dynamic tool timeout logs could contain malformed emoji or other split surrogate-pair text when a long dynamic tool log field crosses the truncation boundary.
Why This Change Was Made
Codex dynamic tool timeout diagnostics now use the existing UTF-16-safe truncation helper for normalized log fields while preserving the current 160-character cap and
...marker. This is limited to timeout diagnostic/log formatting and does not change tool execution, timeout behavior, protocol payloads, or persisted data.User Impact
Operators and developers inspecting Codex dynamic tool timeout output can now expect valid UTF-16 snippets for long tool/process fields, including emoji-containing user or tool text, instead of broken surrogate characters at the truncation edge.
Evidence
Pre-submit freshness and competition check:
origin/mainbefore implementation;extensions/codex/src/app-server/dynamic-tool-execution.tsstill used rawnormalized.slice(0, LOG_FIELD_MAX_LENGTH - 3).extensions/codex/src/app-server/dynamic-tool-execution.ts.Issue-specific runtime proof:
processaction/session fields and observed UTF-16-safe truncated fields.Regression test:
Additional checks: