fix(cli): keep session key tables Unicode-safe#103010
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 1:03 PM ET / 17:03 UTC. Summary PR surface: Source +1, Tests +14. Total +15 across 2 files. Reproducibility: yes. The linked issue gives a concrete CLI fixture, and current main's raw formatter slices make the dangling-surrogate failure clear from source inspection. 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. Next step before merge
Security Review detailsBest possible solution: Land the shared formatter fix after normal exact-head CI and maintainer merge handling, keeping JSON output and persisted session keys unchanged. Do we have a high-confidence way to reproduce the issue? Yes. The linked issue gives a concrete CLI fixture, and current main's raw formatter slices make the dangling-surrogate failure clear from source inspection. Is this the best way to solve the issue? Yes. Updating the shared formatter is the narrowest maintainable fix because both affected table surfaces call it; caller-specific fixes or AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cd50d4983b2f. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +14. Total +15 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 proof for exact head
Known proof gaps: none within the issue scope. Grapheme/display-width alignment is intentionally separate from preventing malformed UTF-16 output. |
|
Merged via squash.
|
Closes #103001
AI-assisted: yes (Codex).
What Problem This Solves
Fixes an issue where operators listing sessions, or previewing session cleanup, could see replacement characters in a long session key when an emoji or other supplementary-plane character crossed either truncation boundary.
Why This Change Was Made
The shared session-table formatter now uses the canonical UTF-16-safe prefix and suffix helpers while preserving its existing 16-unit prefix, ellipsis, 6-unit suffix, and 26-unit cell budget. A focused regression test places emoji across both retained boundaries so the old raw slicing fails deterministically.
This stays at the shared formatter owner boundary: normal session listing and cleanup dry-run both benefit, while JSON output and persisted keys remain unchanged.
User Impact
Long Unicode session keys remain recognizable in terminal tables instead of displaying
�characters. ASCII keys, short keys, output width, and the meaningful prefix/suffix layout keep their existing behavior.Evidence
Blacksmith Testbox lease:
tbx_01kx3w5bfyc64dwp5g3rj4cr7y(brisk-crayfish).pnpm test src/commands/sessions-table.test.ts: 1/1 passed.pnpm test src/commands/sessions-table.test.ts src/commands/sessions.test.ts src/commands/sessions-cleanup.test.ts: 26/26 passed across three files.pnpm check:changed: passed (core + coreTests; typecheck, lint, and guards clean).openclaw sessions --store /tmp/openclaw-sessions-utf16.json --limit allrenderedaaaaaaaaaaaaaaa...zzzzzwithout replacement characters.aaaaaaaaaaaaaaa�...�zzzzz.f4fa56da1449596c9f23a6aacf47f06fff7c5737: CI run and real behavior proof passed. Verification snapshot: 65 successful checks, 36 skipped, zero failures or pending checks.git diff --check: passed.