[GH-ISSUE #169] [Bug]: Ralph crashed due to a UTF-8 boundary issue #65

Closed
opened 2026-02-27 10:22:01 +03:00 by kerem · 1 comment
Owner

Originally created by @jarod on GitHub (Feb 11, 2026).
Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/169

Operating system

macOS 15.7

Ralph version

ralph 2.5.0

AI backend

Claude Code

Hat preset / workflow

spec-driven

Steps to reproduce

⏺ Bash(ralph run --config presets/spec-driven.yml)                                                                                                                                                                                                                                                                     
  ⎿  Error: Exit code 101                      
                                                                                                                                                                                                                                                                                                                       
     thread 'main' (5222433) panicked at crates/ralph-cli/src/main.rs:1267:36:
     byte index 100 is not a char boundary; it is inside '回' (bytes 99..102) of  ...

⏺ Ralph crashed due to a UTF-8 boundary issue — it's trying to truncate the PROMPT.md at byte 100, which lands in the middle of a multi-byte Chinese character. This is a bug in Ralph's string slicing.

  A workaround is to restructure the PROMPT.md so the first ~100 bytes are ASCII only (move the Chinese text further down).   

Expected behavior

not to crash

Actual behavior

thread 'main' (5222433) panicked at crates/ralph-cli/src/main.rs:1267:36:

Logs or error output


Config / preset file

No response

Originally created by @jarod on GitHub (Feb 11, 2026). Original GitHub issue: https://github.com/mikeyobrien/ralph-orchestrator/issues/169 ### Operating system macOS 15.7 ### Ralph version ralph 2.5.0 ### AI backend Claude Code ### Hat preset / workflow spec-driven ### Steps to reproduce ```bash ⏺ Bash(ralph run --config presets/spec-driven.yml) ⎿ Error: Exit code 101 thread 'main' (5222433) panicked at crates/ralph-cli/src/main.rs:1267:36: byte index 100 is not a char boundary; it is inside '回' (bytes 99..102) of ... ⏺ Ralph crashed due to a UTF-8 boundary issue — it's trying to truncate the PROMPT.md at byte 100, which lands in the middle of a multi-byte Chinese character. This is a bug in Ralph's string slicing. A workaround is to restructure the PROMPT.md so the first ~100 bytes are ASCII only (move the Chinese text further down). ``` ### Expected behavior not to crash ### Actual behavior thread 'main' (5222433) panicked at crates/ralph-cli/src/main.rs:1267:36: ### Logs or error output ```shell ``` ### Config / preset file _No response_
kerem 2026-02-27 10:22:01 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@mikeyobrien commented on GitHub (Feb 13, 2026):

Fixed in recent release - the truncate function now properly handles UTF-8 boundaries using char_indices() to find valid character boundaries before slicing.

<!-- gh-comment-id:3894466944 --> @mikeyobrien commented on GitHub (Feb 13, 2026): Fixed in recent release - the truncate function now properly handles UTF-8 boundaries using char_indices() to find valid character boundaries before slicing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ralph-orchestrator#65
No description provided.