Skip to content

fix(infinity-agent-cli): truncate Unicode display labels safely - #180

Draft
kaluli123123 wants to merge 1 commit into
hydro-project:mainfrom
kaluli123123:fix/unicode-display-118
Draft

kaluli123123 wants to merge 1 commit into
hydro-project:mainfrom
kaluli123123:fix/unicode-display-118

Conversation

@kaluli123123

@kaluli123123 kaluli123123 commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

  • Keep every reported display slice on a UTF-8 boundary and calculate remote label offsets in character units.

Closes #118.

Root cause

Arbitrary byte slices in the session picker and terminal short IDs could split UTF-8; remote label offsets mixed bytes and characters.

Test plan and evidence

  • RED before repair: Picker panicked at byte 7 inside é; two terminal flows panicked at byte 8 inside é.
  • Focused: CLI library 17 passed; tui_flow_snapshots 15 passed, including 3 new regression tests (the picker test covers 3 cases).
  • Runtime: cargo-run temporary example invoked the public terminal loop against a virtual terminal: status 1234567 | /help, child subscription [1234567] ⚡watch: changed, picker 123456….
  • Rust formatting, workspace Clippy with warnings denied, and all-target compilation passed through ./check.bash.
  • cargo test --locked --all-targets --no-fail-fast: 358 passed, 7 failed, 0 ignored. The exact same seven failures independently reproduced on clean base 1abc6fcff1f186124f924b56aa92c3a3684c90c5 (355 passed, 7 failed, 0 ignored), across tui_reflow_snapshots (6) and tui_submit_wrap_snapshots (1). No snapshots or thresholds were changed.
  • cargo test --locked --doc: 45 passed, 1 ignored.
  • Independent read-only review: no blocking findings.

Changed files

  • crates/infinity-agent-cli/src/session_picker.rs
  • crates/infinity-agent-cli/src/terminal.rs
  • crates/infinity-agent-cli/tests/tui_flow_snapshots.rs
  • docs/docs/infinity-code/overview.md

Remaining gates

Draft: required full checks are not green. Remote CI and maintainer review remain outstanding. Docs/UI Prettier were skipped by the repository script because node_modules are absent; optional browser e2e and THIRD-PARTY verification were not reached after the test gate failed. No live model account was used.

One independent commit from base 1abc6fcff1f186124f924b56aa92c3a3684c90c5. No dependency or wire-protocol changes. No merge, deployment, or Issue closure performed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

infinity-agent-cli: display truncation slices strings by byte index, can panic on non-ASCII

1 participant