fix(gateway): keep dashboard titles UTF-16 safe#101646
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: the PR is a focused fix, but it leaves the real generated-title path incomplete because Canonical path: Close this PR as superseded by #101580. So I’m closing this here and keeping the remaining discussion on #101580. Review detailsBest possible solution: Close this PR as superseded by #101580. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main slices dashboard title strings by raw UTF-16 code units at the 60 and 1000 limits, and the PR still leaves a raw generated-label slice before normalization. Is this the best way to solve the issue? No: the helper choice is right, but applying it only in Security review: Security review cleared: The diff only swaps string truncation helper usage and adds unit tests; it does not touch credentials, dependencies, workflows, or other supply-chain surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 60f0749b7fb3. |
|
Closed as superseded by #101685, landed in |
What Problem This Solves
Fixes dashboard session title truncation paths that could cut UTF-16 surrogate pairs in half. Both the generated display title normalization and the utility-model prompt input limit previously used raw
.slice(...), which can leave malformed text when the boundary lands inside an emoji or other non-BMP character.Why This Change Was Made
Recent title and channel truncation fixes use the shared
truncateUtf16Safehelper for user-visible text. This applies the same existing helper to dashboard session title generation without changing title limits or model-selection behavior.User Impact
Dashboard session titles and first-message title prompts stay well-formed when user messages or generated titles contain emoji or non-BMP characters near truncation boundaries.
Evidence
node scripts/run-vitest.mjs src/gateway/dashboard-session-title.test.tssrc/gateway/dashboard-session-title.test.tspassed in the gateway shard: 48 tests passed.git diff --checkpython .agents\skills\autoreview\scripts\autoreview --mode local --no-web-searchautoreview clean: no accepted/actionable findings reportedorigin/mainat2ba622ca30