Skip to content

fix: make diagnostic truncation UTF-8 safe#228

Open
andrei-hasna wants to merge 1 commit into
mainfrom
hotfix/utf8-truncation
Open

fix: make diagnostic truncation UTF-8 safe#228
andrei-hasna wants to merge 1 commit into
mainfrom
hotfix/utf8-truncation

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Why

Byte-index slicing and truncation can panic when diagnostics contain multibyte UTF-8 characters.

What

Introduce shared character-boundary truncation handling across client, cloud, and rollout diagnostic paths, including a reusable cloud helper. Add runnable client regression tests while preserving cloud UI snapshot coverage and Bazel snapshot data wiring.

Tests

Local verification:

  • just test -p codex-client — 2/2 passed
  • just test -p codex-cloud-tasks — 16/16 passed, 1 pre-existing ignored
  • just test -p codex-rollout — 48/48 passed
  • cargo insta pending-snapshots -p codex-cloud-tasks — no pending snapshots
  • bazel test //codex-rs/client:client-unit-tests — passed
  • just bazel-lock-check — passed

@andrei-hasna
andrei-hasna force-pushed the hotfix/utf8-truncation branch from ee0c29b to e0ea851 Compare July 15, 2026 02:06
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.

1 participant