fix(crestodian): keep prompt history UTF-16 safe#102627
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 9:45 AM ET / 13:45 UTC. Summary PR surface: Source +1, Tests +13. Total +14 across 2 files. Reproducibility: yes. from source inspection: current main slices long Crestodian history at 500 UTF-16 code units, so 499 BMP characters followed by an emoji leaves a lone high surrogate. I did not run a live Crestodian session in this read-only review. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 detailsBest possible solution: Land the localized helper-based fix after redacted real Crestodian prompt or run proof confirms long emoji-containing history stays valid Unicode. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main slices long Crestodian history at 500 UTF-16 code units, so 499 BMP characters followed by an emoji leaves a lone high surrogate. I did not run a live Crestodian session in this read-only review. Is this the best way to solve the issue? Yes for the code path: using the existing shared UTF-16-safe truncator at the single history cap is the narrow maintainable fix. The remaining blocker is proof from a real Crestodian prompt/run, not a different implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f6b990124353. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +13. Total +14 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
Review history (3 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
065b708 to
2763011
Compare
|
Merged via squash.
|
* fix(crestodian): keep assistant prompt history truncation UTF-16 safe * test(crestodian): simplify history boundary proof * test(crestodian): add dangling-surrogate proof and raw-slice bug evidence * test(crestodian): remove duplicate UTF-16 cases --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Crestodian bounded each prior conversation turn with raw UTF-16 code-unit slicing before placing it in the planner prompt. A boundary through an emoji or another supplementary character could leave a lone surrogate in model-facing history.
Why This Change Was Made
Oversized turns now use the shared
truncateUtf16Safeprimitive before the existing ellipsis. During review, the regression was consolidated into the established assistant suite, replacing a separate 73-line test module with one exact prompt assertion.User Impact
Long Crestodian conversation turns remain valid Unicode in subsequent planner prompts. The 500-unit threshold, 12-turn history window, labels, and short-turn behavior are unchanged.
Evidence
git diff --checkpassed.