fix(agent-runner-memory): use truncateUtf16Safe for memory flush error truncation#102685
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: the production UTF-16 truncation fix is already on current main through #102823, but this PR was intentionally reopened for unique focused regression coverage and has maintainer land-ready proof. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this PR as superseded by #102823. So I’m closing this here and keeping the remaining discussion on #102823. Review detailsBest possible solution: Close this PR as superseded by #102823. Do we have a high-confidence way to reproduce the issue? No current-main failure remains to reproduce: #102823 already replaced both raw slices. The PR discussion includes a red-control proof showing the strengthened tests catch the old raw-slice regression. Is this the best way to solve the issue? Yes for the remaining work: after the production fix landed, preserving this as a small test-only delta is the narrowest maintainable path. Reopening solely for the focused regression coverage is better than reapplying the already-merged production change. Security review: Security review cleared: The current useful delta is focused test coverage and the original source hunk only uses an existing internal normalization helper; no dependency, workflow, credential, or supply-chain surface changes were found. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 9775f09194e1. |
…r truncation Replace raw UTF-16 slices in buildMemoryFlushErrorPayload and truncateMemoryFlushErrorMessage with truncateUtf16Safe to prevent surrogate pair splitting in error messages shown to users. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
4ea2aac to
b7b2a25
Compare
|
Thanks @zhangqueping. #102823 landed both UTF-16-safe memory-flush error caps in |
Land-ready proofReviewed exact head Best-fix assessment: the production UTF-16 fix already landed in #102823. Relative to current Evidence:
Known proof gaps: none for this test-only current-main delta. |
|
Correction and current maintainer decision: #102823 superseded this PR's production changes, but exact head This updated maintainer decision supersedes the stale ClawSweeper Full exact-head CI, sanitized AWS green/red proof, signature verification, and autoreview are recorded in the land-ready proof comment, and the PR body now describes the current test-only delta. No further action is needed from @zhangqueping. |
|
🦞✅ Reason: structured ClawSweeper close marker: close-required (sha=6b7095f05add4ff013a48aa5981bee1667511065) Closed:
|
|
Merged via squash.
|
…r truncation (openclaw#102685) * fix(agent-runner-memory): use truncateUtf16Safe for memory flush error truncation Replace raw UTF-16 slices in buildMemoryFlushErrorPayload and truncateMemoryFlushErrorMessage with truncateUtf16Safe to prevent surrogate pair splitting in error messages shown to users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * test(auto-reply): cover UTF-16-safe memory errors * test(auto-reply): tighten UTF-16 memory error coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
…r truncation (openclaw#102685) * fix(agent-runner-memory): use truncateUtf16Safe for memory flush error truncation Replace raw UTF-16 slices in buildMemoryFlushErrorPayload and truncateMemoryFlushErrorMessage with truncateUtf16Safe to prevent surrogate pair splitting in error messages shown to users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) * test(auto-reply): cover UTF-16-safe memory errors * test(auto-reply): tighten UTF-16 memory error coverage --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
The production UTF-16-safe memory-flush truncation fix already landed through #102823. This PR now retains the unique regression coverage needed to keep both shipped boundaries from returning to raw surrogate-splitting slices:
Relative to current
main, the repaired branch is a test-only+6/-5delta in the existing agent-runner memory integration test module.Why This Change Was Made
The two existing behavior tests now place emoji directly across their real truncation boundaries instead of checking only long ASCII text or an uncapped generic error. This proves the existing production helper keeps complete surrogate pairs while preserving redaction, length caps, ellipses, failure counters, timestamps, and persisted session state.
The branch also removes a redundant 47-line combined test in favor of strengthening those two owner-path regressions. It does not reapply or change the production fix from #102823.
User Impact
No additional runtime behavior changes beyond #102823. The retained tests prevent future regressions that could corrupt emoji or other supplementary-plane characters in visible or persisted memory-flush errors.
Evidence
Final exact head:
6b7095f05add4ff013a48aa5981bee1667511065(valid GitHub-verified maintainer signature; original contributor credit preserved).src/auto-reply/reply/agent-runner-memory.tsis byte-identical; onlysrc/auto-reply/reply/agent-runner-memory.test.tsdiffers (+6/-5).🚀…suffix.🚀tailmust persist exactly 198 ASCII code units plus…, while retaining the failure count and timestamp assertions.run_b8a5f2bc7e95, 47/47 focused-module tests passed on the exact hosted head with public networking, no Tailscale, no hydration, and no instance profile.run_10558da929c0. Replacing only the two safe production truncations with their former raw slices made exactly the two strengthened tests fail; the harness emittedEXPECTED_RED_CONFIRMED test_exit=1 failures=2.oxfmt --write src/auto-reply/reply/agent-runner-memory.test.ts;git diff --check.Known proof gaps: none for this test-only current-main delta.
Files Changed
src/auto-reply/reply/agent-runner-memory.test.ts