CLI 0.162.0 panics at terminal_hyperlinks.rs:392: UTF-8 boundary inside ➡ while rendering Chinese text
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start at remap_source_wrapped_line in codex-rs/tui/src/terminal_hyperlinks.rs near line 392, where text[source_byte..wrapped.range.start] panics. Trace where wrapped.range values come from, since the invalid offset is the upstream cause, and note that the #52330 clamp does not cover it. Done means a regression test that remaps long CJK text with emoji such as ➡️ across several wrap widths without panicking, with visible text and source mappings preserved.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What version of Codex CLI is running?
codex-cli 0.162.0, installed globally via npm (@openai/codex). The npm latest endpoint also returned 0.162.0 when checked.
What subscription do you have?
Not provided.
Which model were you using?
Not confirmed for the crashing turn.
What platform is your computer?
Linux 7.0.0-38-generic x86_64 GNU/Linux.
What terminal emulator and version are you using (if applicable)?
Kitty 0.49.0, with zsh.
Codex doctor report
Not collected. No account credentials or private workspace logs are included in this report.
What issue are you seeing?
The interactive Codex CLI panicked and exited to the shell while handling a Chinese question containing emoji. The terminal retained this error:
The application panicked (crashed).
Message: end byte index 159 is not a char boundary; it is inside '➡' (bytes 158..161) of [application text omitted for privacy]
Location: tui/src/terminal_hyperlinks.rs:392
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
What steps can reproduce the bug?
This is an observed crash, not yet a deterministic end-to-end reproducer. The exact terminal dimensions and triggering UI action were not captured, and a full backtrace is unavailable.
- Run
codexversion 0.162.0 in Kitty. - The affected interaction contains a long Chinese question, including
➡️(business text omitted). - The TUI exits with the panic above during source-range remapping.
The application's business text has been omitted for privacy. The original panic identifies ➡ at UTF-8 bytes 158..161; offset 159 is inside that character.
What is the expected behavior?
Rendering/wrapping Chinese text and emoji should not terminate the CLI. Source ranges used for slicing should remain valid UTF-8 boundaries and correctly map to the displayed text.
Additional information
The reported location matches the code in the 0.162.0 tag:
https://github.com/openai/codex/blob/rust-v0.162.0/codex-rs/tui/src/terminal_hyperlinks.rs#L392
Inside remap_source_wrapped_line:
source_column += display_width(&text[source_byte..wrapped.range.start]);
The panic indicates that the range start used here was inside a multibyte character. The upstream cause of the invalid wrapped range still needs investigation; this report does not establish that the arrow alone always triggers a crash.
Related change: #52330 (commit 22ebb0fb178fe369190123c256ba200585765725) clamps wrapped range offsets to text.len() to address a cursor sentinel past the end of the input. That particular clamp does not address this case: 159 is already below the input length but is not a character boundary. A local Python byte-boundary check using the reported text confirmed that min(159, len(text.encode("utf-8"))) remains 159 and the prefix still fails UTF-8 decoding. This was a boundary check only, not a Rust/TUI regression test.
Suggested investigation/regression coverage: exercise source-range remapping of long CJK questions with emoji/variation selectors across different wrap widths, and check both in-bounds character boundaries and preservation of visible text/source mappings.
- Lingua principale
- Rust
- Stelle
- 133k
- Fork
- 21.1k
- Merge medio
- 1m
- PR unite (30g)
- 997
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openai/codex
-
CI blob-size checker skips symlink-to-regular-file changes above its size limitForse già presa @akhil9tiet l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openai/codex#59650 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug CLI enhancement TUI
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
bug memory windows-os
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Skill Creator quick validator rejects standard compatibility frontmatterForse già presa @akhil9tiet l’ha presa 5 giorni fa. Apertabug skills
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openai/codex#58538 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di openai/codex
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
I maintainer di solito rispondono entro 1 giorno
-
🐞 bug 🧩 bevy_gantz_egui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
nannou-org/gantz#500 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Fedora 45 repoApertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
metasequoiaime/msime#10989 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
fritzprix/libr-agent#2612 ·
I maintainer di solito rispondono entro 1 giorno
-
find: -printf %h drops a doubled slashForse già presa @qodelicious l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno