Repository navigation
fix: write trajectory exports as utf-8 - #14810
Merged
Merged
Conversation
Contributor
|
👋 Thanks for opening this PR! Your PR is marked for review. Can you confirm with a 👍 reaction on this comment or a reply that this PR is ready to review?
|
wgu9
force-pushed
the
fix-trajectory-export-utf8
branch
from
June 15, 2026 01:32
b7fcf6b to
401506d
Compare
This was referenced Jun 16, 2026
Contributor
|
🚀 Released in cloud-1.39.0. |
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
This PR makes trajectory exports explicitly write event and metadata JSON as UTF-8, so conversations with non-ASCII content export consistently on platforms whose default encoding is not UTF-8. The change is limited to the export write boundary and covered by a regression test that simulates a non-UTF-8 platform default.
Summary
event_*.jsonfiles andmeta.jsonwith explicit UTF-8 encoding.Why
export_conversation()writes JSON files before zipping the trajectory. Without an explicit encoding, Python uses the platform default. On Windows-style defaults such ascp1252, metadata or event payloads containing non-ASCII characters can fail to write or produce inconsistent export bytes.The exported trajectory is already consumed as UTF-8 by existing tests and clients, so the write boundary should use the same encoding explicitly.
Edge cases covered
Validation
uv run --group test pytest tests/unit/app_server/test_live_status_app_conversation_service.py -quv run ruff format --check openhands/app_server/app_conversation/live_status_app_conversation_service.py tests/unit/app_server/test_live_status_app_conversation_service.pyuv run ruff check openhands/app_server/app_conversation/live_status_app_conversation_service.py tests/unit/app_server/test_live_status_app_conversation_service.pygit diff --check