fix: handle utf-8 in windows sandbox logs (#8647)

Currently `apply_patch` will fail on Windows if the file contents happen
to have a multi-byte character at the point where the `preview` function
truncates.

I've used the existing `take_bytes_at_char_boundary` helper and added a
regression test (that fails without the fix).

This is related to #4013 but doesn't fix it.
This commit is contained in:
David Gilbertson authored and GitHub committed 2026-01-26 15:11:27 -08:00
1 parent 159ff06281
commit 313ee3003b
3 files changed
+21 -1

No files matched your search

+1
View File
@@ -2006,6 +2006,7 @@ dependencies = [
"chrono",
"codex-protocol",
"codex-utils-absolute-path",
"codex-utils-string",
"dirs-next",
"dunce",
"pretty_assertions",