fix(active-memory): keep timeout partial replies valid at emoji caps#102920
Conversation
|
Closing this PR because the author has more than 20 active PRs in this repo. Please reduce the active PR queue and reopen or resubmit once it is back under the limit. You can close your own PRs to get back under the limit. |
|
Thanks @zhangguiping-xydt. Recording final folded proof after this PR's queue-limit closure. The original timeout-only head is c53382e1. It was resubmitted unchanged in #102940 and then folded into canonical #102877, which landed on current main as f1e7081b. Current main includes this PR's single-record timeout regression plus the stronger multi-record boundary regression and bounded-prefix implementation: UTF-16-safe per-record truncation, stop-on-truncation or surrogate backoff, and exact separator accounting. It also fixes the sibling recent-conversation recall path, so no unique work remains to reopen here. Your timeout-path work remains credited in folded source commit c0d70155 and in the landed commit. Full red/green and exact-head proof is recorded in the land-ready evidence. Thank you. |
What Problem This Solves
Fixes an issue where active-memory timeout recovery could attach a partial assistant transcript containing a broken UTF-16 surrogate when the transcript cap lands inside an emoji or other surrogate-pair character.
Why This Change Was Made
The partial transcript reader now applies the same UTF-16-safe truncation used by other active-memory text caps before storing or returning bounded assistant text. The fix stays limited to partial assistant transcript collection and does not change transcript parsing, memory search behavior, or summary generation.
User Impact
Users who hit active-memory timeout recovery can expect partial assistant replies to remain valid text instead of exposing replacement characters or malformed emoji boundaries in the recovered timeout context.
Evidence
Confirmed
origin/mainstill used rawslice(0, remaining)and final joinedslice(0, resolvedLimits.maxChars)inreadPartialAssistantText; fix(active-memory): recall context breaks when recent turns contain emoji #102877 only covered the recent-turn recall query path.Searched open PRs for
readPartialAssistantText,activeMemoryPartialReply,partial assistant,surrogate, andUTF-16; no open PR was covering this same problem.Focused validation: