Skip to content

fix(tier3): skip non-object events when rebuilding agent logs - #728

Merged
rng1995 merged 18 commits into
NVIDIA:mainfrom
Afloat16:fix/skip-nonobject-log-events
Nov 23, 2026
Merged

rng1995 merged 18 commits into
NVIDIA:mainfrom
Afloat16:fix/skip-nonobject-log-events

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Claude Code and Cline log reconstruction already skips non-JSON noise, but valid JSON values such as null, arrays, booleans, numbers and strings reach .get() without an object check. A single such line raises AttributeError and prevents recovery of valid tool evidence around it. Cline has the same issue inside the JSON-encoded say: tool payload.

Skip these non-event values before reading event fields. Valid events, tool-result pairing and fallback source selection retain their existing behavior, matching the object checks already present in the OpenCode and Codex parsers.

Merge and current verification

At fa71312fb83ac6c36be3095457bbef6e6f81c52e, merged upstream main 3ecd69bd7fb189df064821ea637f99ba4a2007d7. The only conflict was in CHANGELOG.md; both this PR's release note and the upstream scanner-install note are retained. This PR's production code and tests are byte-for-byte unchanged from ce805c7ffaf5388d0c048bc44b21ad7818c1110f.

Re-ran the log-event-shape, log-converter and Harbor collector-runtime-failure test modules listed below: 244 passed on Linux with Python 3.12.14. Also passed python -m ruff check src tests, Ruff formatting for the changed Python files, the OSS boundary check, and python -m build (wheel and sdist). Hosted workflows for this merge commit await maintainer approval.

Original verification

All 17 new cases fail on unchanged base 8fe9723. The tests compare reconstructed trajectories with clean-log equivalents, including tool calls and observations, cover five non-object JSON types and nested Cline tool payloads, and exercise both file-based fallback paths.

python -m pytest tests/tier3/test_log_event_shapes.py tests/tier3/test_log_converters.py tests/test_harbor_collector_runtime_failures.py -q — 230 passed.

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests
  • Updated documentation for user-visible changes (Unreleased changelog)
  • Ran make lint equivalent: python -m ruff check src tests
  • Full make test did not complete successfully in this environment (see below)
  • Ran make build equivalent: python -m build (wheel and sdist)
  • Did not add credentials, private datasets, or proprietary benchmark content

The unchanged base 8fe9723, tested with python -m pytest -x -q, stops after 456 passed and 19 deselected at tests/ci/test_gateway_benchmark_workflows.py::test_gitlab_enriched_tier1_applies_the_keyless_job_baselines[extra0-expected0]. The sandbox has no /tmp, while that workflow fixture explicitly invokes mktemp -d /tmp/skillevaluator-enriched-tier1.XXXXXX. The same test fails for the same reason on the retry branch. No full-suite pass is claimed.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

Current CI baseline (2026-11-22)

At head 320c700382224f3474e9762592c5830ff713b852, the Python 3.12 CI job fails tests/test_cli_banner.py::test_noninteractive_invocations_preserve_streams_and_exit_codes[args2-0-stdout]: -h exits 2 instead of 0.

The same failure reproduces on pristine upstream main 4964c8b301cadbc121e126c268d06e201047133c, using the frozen dependency lock with Python 3.12.14 and Click 8.4.2. Running these existing tests in this order gives 1 passed, 1 failed:

python -m pytest -q tests/test_cli.py::test_help_emits_color_when_enabled 'tests/test_cli_banner.py::test_noninteractive_invocations_preserve_streams_and_exit_codes[args2-0-stdout]'

The first test renders help using a bare click.Context(cli, ...), which initializes the shared command's cached help option with only --help. The following -h invocation then reports No such option '-h'. This isolates an upstream test-order dependency; the full CI suite is not green.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is worth having. I confirmed on main that a single null or [] line in claude-code.txt or cline.txt, or a Cline say: tool event whose text decodes to a number or string, raises AttributeError, and since load_trajectory_with_fallback and its callers do not catch it the whole trial load aborts rather than just losing that line. The new guards match what the OpenCode and Codex parsers already do, and skipping quietly is consistent with how a non-JSON line is already handled right above. The existing log converter tests give the same results before and after, and the 17 new cases fail on main and pass here. One nit on the CHANGELOG formatting inline; otherwise good to go.

Comment thread CHANGELOG.md Resolved
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Afloat16, for making Claude/Cline log reconstruction tolerate non-object JSON events and Cline tool payloads. The guards skip malformed records while preserving valid surrounding tool calls and results, including through the fallback loader. I found no new actionable issues on this head.

Validation: 45 focused event-shape and existing log-converter tests passed.

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Afloat16 for this contribution! I reviewed b1d5f91181. I reproduced the problem on main, confirmed this change fixes it, checked that the new tests fail on main, and ran the new and related tests on this head (all pass). I left 1 inline comment (1 P3); please take a look.

Comment thread CHANGELOG.md Resolved
Merge current main while retaining this change and the published release notes.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@Afloat16

Copy link
Copy Markdown
Contributor Author

Moved this fix into the current Unreleased section.

Commit 8589364 resolves the changelog conflict, keeps the Fixed list contiguous, and leaves main's published release notes unchanged. The existing production and test blobs are unchanged. Hosted workflows await maintainer approval.

@Afloat16
Afloat16 requested a review from rng1995 November 18, 2026 04:26
@rng1995
rng1995 enabled auto-merge (squash) November 18, 2026 05:15
Resolve the Unreleased changelog conflict while retaining both entries.
Preserve the reviewed PR implementation and published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
auto-merge was automatically disabled November 18, 2026 06:07

Head branch was pushed to by a user without write access

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Afloat16 for this contribution and for addressing the earlier review! I re-checked ce805c7ffa: all 1 earlier comment is resolved in the code, the tests pass, and I found nothing new. Approving.

Resolve the CHANGELOG.md conflict by retaining both the existing PR entry and the upstream scanner-install entry.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
Signed-off-by: Afloat <ShuffleMonkey@163.com>
@rng1995

rng1995 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

@Afloat16 - Please resolve merge conflict to merge the PR.

Synchronize with NVIDIA/SkillEvaluator main f867b7f.
Retain this PR's entry under Unreleased and preserve published release history.

Signed-off-by: Afloat <ShuffleMonkey@163.com>
@Afloat16

Copy link
Copy Markdown
Contributor Author

Resolved the merge conflict in 5897fd2e5f by merging current main f867b7f311. The PR's release note remains under Unreleased, and published release history is unchanged.

The implementation and regression-test patch has the same stable patch ID before and after synchronization. On the exact merged tree, 45 focused tests passed (Linux, Python 3.12.14); full-source Ruff, changed-file formatting, and git diff --check pass.

Hosted checks on this head have completed: 21 successful, 2 skipped, no failures. The CI workflow passed.

rng1995 and others added 3 commits November 20, 2026 10:41
CHANGELOG.md: keep main's Unreleased section unchanged and list this fix
first under Unreleased > Fixed, directly above main's trajectory-recovery entry.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Resolve the CHANGELOG.md conflict by keeping main's entries and this change's entry under Unreleased.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Afloat16 for this contribution! I re-checked 320c70038: I merged current main into the branch (the only conflict was CHANGELOG.md, resolved by keeping main's entries and this entry under Unreleased), confirmed that every earlier review comment is addressed in the code, and ran this PR's tests and ruff, which pass. I found nothing new. Approving.

Preserve the log recovery entry under Unreleased alongside current main.

Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the refreshed head and the Click help-test isolation fix. The focused CLI and log-recovery suites passed all 206 tests, and Ruff and diff checks passed.

@rng1995
rng1995 merged commit 8377385 into NVIDIA:main Nov 23, 2026
23 checks passed
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.

3 participants