Skip to content

fix(band): preserve Unicode characters when truncating session names - #1385

Open
dungartoriaaa wants to merge 1 commit into
DietrichGebert:mainfrom
dungartoriaaa:codex/fix-unicode-session-titles
Open

dungartoriaaa wants to merge 1 commit into
DietrichGebert:mainfrom
dungartoriaaa:codex/fix-unicode-session-titles

Conversation

@dungartoriaaa

Copy link
Copy Markdown

Fixes #1384

Tiêu đề có 59 ký tự ASCII rồi tới 😀 hiện bị cắt thành một surrogate đơn. Khi ghi CSV UTF-8, ký tự đó trở thành �. Bản sửa giới hạn tên phiên theo 60 Unicode code point ở cả prompt đầu tiên, tên hội thoại đã đổi và phiên import, giữ nguyên ký tự đầy đủ.

Chỉ sửa 3 dòng xử lý tên và thêm kiểm thử hồi quy cho ba đường vào. Các kiểm thử mới đều thất bại trên 96608e0 và đạt sau sửa. Kiểm thử CSV còn xác nhận tên được giữ nguyên khi mã hóa UTF-8.

Kiểm chứng

  • npm test đạt 144 kiểm thử gốc và 30 kiểm thử pi.
  • node scripts/check-rule-copies.js đạt.
  • node scripts/check-versions.js đạt.
  • python benchmarks/agentic/run.py --selftest đạt.
  • claude plugin test . có 29 đạt và 5 lỗi có sẵn trên Windows. Trên bản gốc có 27 đạt và cùng 5 lỗi, trùng các trường hợp được báo trong band tests fail on Windows: fs.read mocks compare an exact POSIX path #1375. Hai kiểm thử mới đều đạt sau sửa.
  • Đã mở board được tạo từ CSV bằng Playwright, xác nhận tiêu đề đủ 60 code point, emoji cuối hiển thị nguyên vẹn và không có ký tự thay thế.

English summary

Truncate session names by Unicode code point instead of UTF-16 code unit in all three naming paths. This prevents a supplementary character at the 60-character boundary from becoming a lone surrogate and then � in UTF-8 CSV or UI output. Regression coverage includes first prompts, custom titles, imported sessions and a CSV/board round trip. The two new plugin tests pass. Five existing Windows plugin-test failures reproduce unchanged on the base revision, as described in #1375. All required contribution checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Band truncation splits Unicode characters and corrupts session names

1 participant