aws / aws/amazon-q-developer-cli

Panic when byte index is not a char boundary on non-ASCII strings

Open
#3,170 1 comment 0 reactions 0 assignees View on GitHub
bug q chat
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 26.0.1 (25A362)

### Expected behaviour

Q CLI 能夠正確處理包含中文或其他多位元 UTF-8 字元的輸入文字,而不會發生 panic 或 crash。訊息應該成功送出並回傳正常回應。

### Actual behaviour

當輸入包含中文時,Q CLI 發生 panic 並 crash,錯誤訊息如下:
The application panicked (crashed).
Message: byte index 60 is not a char boundary; it is inside '成' (bytes 59..62) of `移除 eagleeye-ec-databases 任務狀況確認…`
Location: crates/chat-cli/src/cli/chat/checkpoint.rs:373
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

### Steps to reproduce

1. 安裝並開啟 Amazon Q CLI(版本 x.y.z)。
2. 在終端機執行以下命令,將引號內的文字替換為包含中文的訊息:
```
q chat "移除 eagleeye-ec-databases 任務狀況確認,最後完成後把 eagleeye-ec-databases & eagleeye-v2-databases 的操作紀錄與關鍵資訊記錄到文件 rds-20251015.md 裡面"
```
3. 觀察 CLI 回報 panic 並 crash,而非正常處理並回傳結果。
4. 若需要更完整的回溯,可設定環境變數並重現:
```
export RUST_BACKTRACE=1
q chat "…"
```

### Environment

```yaml

[q-details]
version = "1.18.1"
hash = "5610605baef17b76ef41448f2e943f021c2b2273"
date = "2025-10-13T22:31:07.064465Z (1d ago)"

[system-info]
os = "macOS 26.0.1 (25A362)"
chip = "Apple M1 Pro"
total-cores = 8
memory = "32.00 GB"

[environment]
cwd = "/Users/USER/Library/Mobile Documents/com~apple~CloudDocs/Works/AmazonQ/aws/reddoor/rds"
cli-path = "/Users/USER/Library/Mobile Documents/com~apple~CloudDocs/Works/AmazonQ/aws/reddoor/rds"
install-method = "brew"

[env-vars]
PATH = "/opt/homebrew/opt/php@8.2/sbin:/opt/homebrew/opt/php@8.2/bin:/Users/USER/.codeium/windsurf/bin:/opt/homebrew/opt/mysql-client/bin:/Users/USER/.local/bin:/Users/USER/.nvm/versions/node/v23.1.0/bin:/Users/USER/.oh-my-zsh/custom/plugins/git-open:/usr/local/opt/coreutils/libexec/gnubin:/Users/USER/bin:/Users/USER/.local/bin:/usr/local/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/USER/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/USER/Library/Python/3.13/bin"
QTERM_SESSION_ID = "8eee7e8886a244ea8bca60eee85faea7"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.18.1"
Q_USING_ZSH_AUTOSUGGESTIONS = "1"
SHELL = "/bin/zsh"
TERM = "xterm-256color"
__CFBundleIdentifier = "com.googlecode.iterm2"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.