Skip to content

Panic in goose projects command when handling Japanese text: byte index not on char boundary #2818

@toyamagu-2021

Description

@toyamagu-2021

Describe the bug

Describe the bug

The goose projects command panics with a character boundary error when processing Japanese text. Specifically, it fails when trying to slice a UTF-8 encoded Japanese string at byte index 37, which falls in the middle of the Japanese character '内' (bytes 36-39).

To Reproduce
Steps to reproduce the behavior:

Set up an environment with Japanese text in project descriptions or session names
Run goose projects command in terminal
The following panic error occurs:
thread 'main' panicked at crates/goose-cli/src/commands/project.rs:203:52:
byte index 37 is not a char boundary; it is inside '内' (bytes 36..39) of `現在のディレクトリの変更内容からGitHub PRを作成してください。 ...

Expected behavior

The command should display the project selection screen normally, even when project information contains Japanese text.

Screenshots

N/A

Please provide following information:

  • **OS & Arch: Mac [e.g. Ubuntu 22.04 x86]
  • **Interface: CLI [UI/CLI]
  • **Version: v1.0.24 [e.g. v1.0.2]
  • **Extensions enabled: No [e.g. Computer Controller, Figma]
  • **Provider & Model: Claude 4 [e.g. Google - gemini-1.5-pro]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions