fix(active-memory): keep bounded search queries UTF-16 safe#102621
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 9, 2026, 6:24 AM ET / 10:24 UTC. Summary PR surface: Source 0. Total 0 across 1 file. Reproducibility: yes. from source inspection: current main still raw-slices the bounded search query at a UTF-16 code-unit boundary. The shared helper implementation and tests show the surrogate-boundary behavior this call site should use. 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 detailsBest possible solution: Land or replace the remaining search-query Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main still raw-slices the bounded search query at a UTF-16 code-unit boundary. The shared helper implementation and tests show the surrogate-boundary behavior this call site should use. Is this the best way to solve the issue? Yes for the intended code shape: using the existing plugin SDK text helper at the caller is the narrowest maintainable fix. The mergeable end state should pair that code change with contributor real behavior proof, and a focused search-query regression test would further reduce review risk. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2f66c3c0c845. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0. Total 0 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
Review history (1 earlier review cycle)
|
Co-authored-by: lizeyu-xydt <[email protected]>
eec70a1 to
7d24864
Compare
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Active Memory bounds the normalized latest-message search query to 480 UTF-16 units before placing it in the memory-search prompt. A raw slice could leave a dangling surrogate when an emoji crossed that boundary.
Why This Change Was Made
Rebuilt the PR on current
main, removed the log-value hunk already landed in #102551, and applied the existing shared UTF-16-safe truncator only to the remaining search-query owner.User Impact
Long Active Memory search queries remain valid Unicode at the same 480-unit limit. Query mode, filtering, prompt structure, and ASCII behavior are unchanged.
Evidence
before_prompt_buildregression that inspects the bounded search query at the surrogate boundary.oxfmt,oxlint, andgit diff --checkpassed.Co-authored-by: lizeyu-xydt [email protected]