Skip to content

json: raise wuffs cursor nesting bound to 16 - #46933

Open
botengyao wants to merge 1 commit into
envoyproxy:mainfrom
botengyao:json-cursor-depth-limit
Open

json: raise wuffs cursor nesting bound to 16#46933
botengyao wants to merge 1 commit into
envoyproxy:mainfrom
botengyao:json-cursor-depth-limit

Conversation

@botengyao

Copy link
Copy Markdown
Member

Commit Message: json: raise wuffs cursor nesting bound to 16

Additional Description:

This raises kMaxTrackedDepth to 17 (effective limit 16), leaving headroom for
nested tool-call arguments, and records the Gemini path in the rationale
comment. Before: nesting at depth >= 9 fails with InvalidArgumentError. After:
depth >= 17 fails. The per-depth tracking arrays are fixed-size and grow with
the constant; the existing TODO about moving to dynamic depth is unchanged.

Risk Level: Low — one compile-time bound is raised, no logic changes.
Per-cursor fixed state grows by 8 array slots.

Testing: Updated the cursor depth boundary tests (16 accepted, 17 rejected) and
added a parser test that a realistic Gemini functionCall.args document parses.

Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Boteng Yao <botengyao@gmail.com>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #46933 was opened by botengyao.

see: more, trace.

@botengyao
botengyao marked this pull request as ready for review August 25, 2026 04:29
@botengyao
botengyao requested a review from tyxia as a code owner August 25, 2026 04:29
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