Skip to content

fix(benchmark): enforce a deterministic driver receipt JSON depth limit - #1331

Merged
yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
skygunner:contrib/benchmark-receipt-json-depth-20261028
Oct 28, 2026
Merged

yyjeqhc merged 1 commit into
yyjeqhc:mainfrom
skygunner:contrib/benchmark-receipt-json-depth-20261028

Conversation

@skygunner

Copy link
Copy Markdown
Contributor

A driver receipt can stay below the 64 KiB size cap while containing deeply nested extra values. _load_driver_receipt currently relies on decoder exceptions, so a valid receipt at depth 129 is accepted rather than rejected as bounded JSON.

Enforce an inclusive depth limit of 128 with an iterative walk after decoding. Preserve the existing file identity, regular-file, UTF-8, size and status checks. Add array/object boundary regressions. Keep excessive integers rejected while allowing the existing test to recognize either decoder error form used across Python versions; deep-input failures still require the bounded-JSON error.

Validation on Python 3.14.8, based on upstream 7cf6442f:

  • The new depth-129 subtests fail on unchanged upstream and pass with the fix.
  • python3 -m unittest scripts.tests.test_agent_loop_benchmark: 51 passed on exact head 37abdd51.
  • git diff --check: passed.

This PR is independent of the host-timing parser change and contains only the benchmark parser and its tests.

@yyjeqhc yyjeqhc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the scoped implementation and regression coverage against its source baseline; CI and diff checks pass. No blocking issue identified.

@yyjeqhc
yyjeqhc merged commit 8a8cf04 into yyjeqhc:main Oct 28, 2026
18 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.

2 participants