Repository navigation
fix(tier3): preserve Unicode content in JSONL agent logs #729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rng1995
merged 17 commits into
NVIDIA:main
from
Afloat16:fix/preserve-unicode-jsonl-content
Nov 23, 2026
Merged
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
64407a7
fix(tier3): preserve Unicode content in JSONL agent logs
Afloat16 dde7cf3
Merge branch 'main' into fix/preserve-unicode-jsonl-content
chrisknvidia d6b3d26
Merge main and retain both release notes
Afloat16 b234142
Merge upstream main after documentation reorganization
Afloat16 72d146f
docs: move pending change notes into Unreleased
Afloat16 6f779ad
Merge upstream main and preserve unreleased notes
Afloat16 b59a5d1
Merge main into fix/preserve-unicode-jsonl-content
Afloat16 8f59d62
Merge main into fix/preserve-unicode-jsonl-content
Afloat16 4447904
chore: integrate main and retain unreleased fixes
Afloat16 bbd6355
chore: integrate latest SkillSpector diagnostics from main
Afloat16 017afe8
chore: merge main and preserve the PR release note
Afloat16 8defeb2
Merge main into fix/preserve-unicode-jsonl-content
rng1995 b21629e
docs(changelog): note the skill_execution scoring effect of the JSONL…
rng1995 65f69e0
docs(changelog): say where CR-only agent logs are and are not split
rng1995 f8079b8
Merge main into afloat/pr-729
rng1995 4687b6a
Merge main into afloat/pr-729
rng1995 06c5637
Merge branch 'main' into fix/preserve-unicode-jsonl-content
rng1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """JSON string content is not a JSONL record separator.""" | ||
|
|
||
| import json | ||
|
|
||
| import pytest | ||
|
|
||
| from skillevaluator.tier3.eval_core.log_converters import ( | ||
| synthetic_trajectory_from_claude_stream_jsonl, | ||
| synthetic_trajectory_from_cline_cli, | ||
| synthetic_trajectory_from_codex_json, | ||
| synthetic_trajectory_from_codex_txt, | ||
| synthetic_trajectory_from_opencode_json, | ||
| ) | ||
|
|
||
|
|
||
| def _events(format_name: str, content: str) -> list[dict]: | ||
| if format_name == "claude": | ||
| return [ | ||
| { | ||
| "type": "assistant", | ||
| "message": { | ||
| "content": [{"type": "tool_use", "id": "t1", "name": "Bash", "input": {"command": content}}] | ||
| }, | ||
| }, | ||
| { | ||
| "type": "user", | ||
| "message": {"content": [{"type": "tool_result", "tool_use_id": "t1", "content": content}]}, | ||
| }, | ||
| {"type": "assistant", "message": {"content": "finished"}}, | ||
| ] | ||
| if format_name == "cline": | ||
| return [ | ||
| {"say": "command", "text": content}, | ||
| {"ask": "command_output", "text": content}, | ||
| {"say": "completion_result", "text": "finished"}, | ||
| ] | ||
| if format_name == "codex": | ||
| return [ | ||
| { | ||
| "type": "item.completed", | ||
| "item": { | ||
| "type": "command_execution", | ||
| "id": "t1", | ||
| "command": content, | ||
| "aggregated_output": content, | ||
| "exit_code": 0, | ||
| }, | ||
| }, | ||
| {"type": "item.completed", "item": {"type": "agent_message", "text": "finished"}}, | ||
| ] | ||
| return [ | ||
| { | ||
| "type": "tool_use", | ||
| "part": { | ||
| "type": "tool", | ||
| "tool": "bash", | ||
| "callID": "t1", | ||
| "state": {"status": "completed", "input": {"command": content}, "output": content}, | ||
| }, | ||
| }, | ||
| {"type": "text", "part": {"type": "text", "text": "finished"}}, | ||
| ] | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("separator", ["\u0085", "\u2028", "\u2029"]) | ||
| @pytest.mark.parametrize("line_ending", ["\n", "\r\n"]) | ||
| @pytest.mark.parametrize( | ||
| ("format_name", "parser"), | ||
| [ | ||
| ("claude", synthetic_trajectory_from_claude_stream_jsonl), | ||
| ("cline", synthetic_trajectory_from_cline_cli), | ||
| ("opencode", synthetic_trajectory_from_opencode_json), | ||
| ("codex", synthetic_trajectory_from_codex_json), | ||
| ("opencode", synthetic_trajectory_from_codex_txt), | ||
| ], | ||
| ) | ||
| def test_literal_unicode_separators_preserve_command_and_output(format_name, parser, line_ending, separator): | ||
| content = f"echo before{separator}after" | ||
| events = _events(format_name, content) | ||
| escaped_log = line_ending.join(json.dumps(event, ensure_ascii=True) for event in events) + line_ending | ||
| literal_log = line_ending.join(json.dumps(event, ensure_ascii=False) for event in events) + line_ending | ||
| expected = parser(escaped_log) | ||
| assert expected is not None | ||
| assert separator in expected["steps"][0]["tool_calls"][0]["arguments"]["command"] | ||
|
|
||
| assert parser(literal_log) == expected |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.