Skip to content

Panic when truncating multibyte session text #3

Description

@dongwook-chan

Summary

csx can panic when a session title or preview contains multibyte UTF-8 characters, such as Korean text.

Reproduction

Run csx with a Codex session whose title/preview contains Korean text long enough to be truncated in the picker row.

Actual behavior

The process panics while formatting the row:

thread 'main' panicked at src/formatting.rs:15:28:
end byte index 157 is not a char boundary; it is inside '그' (...)

Expected behavior

Session text should be truncated without panicking, preserving valid UTF-8.

Root cause

compress_text() uses byte length and byte slicing (clean.len() and &clean[..max_length - 3]) even though Rust string slices must be on UTF-8 character boundaries.

Environment

  • Agent Session Hub: v0.3.6
  • OS: Ubuntu Linux aarch64
  • Provider: Codex

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions