Skip to content

Fix nested template function depth tracking - #523

Open
674019130 wants to merge 1 commit into
mountain-loop:mainfrom
674019130:fix/template-render-depth
Open

Fix nested template function depth tracking#523
674019130 wants to merge 1 commit into
mountain-loop:mainfrom
674019130:fix/template-render-depth

Conversation

@674019130

Copy link
Copy Markdown
Contributor

Summary

Count recursive template-function argument evaluation toward the existing render depth budget. This prevents deeply nested function arguments from bypassing MAX_DEPTH, while preserving normal nesting and the established Throw and ReturnEmpty behaviors.

Root cause

The Val::Fn argument resolver recursively called render_value with the unchanged depth. Unlike variable and returned-template recursion, a chain such as f(value=f(value=...)) could therefore descend without reaching the guard in render.

Submission

  • This PR is a bug fix.
  • If this PR is not a bug fix, I linked the feedback item where @gschier explicitly gave me permission to work on it.
  • I have read and followed CONTRIBUTING.md.
  • I tested this change locally.
  • I added or updated tests, or tests are not reasonable for this change.
  • I added screenshots or recordings, or this change does not affect the UI.

Explicit permission feedback item (required if not a bug fix):

Not required; this is a bug fix.

Related

Verification

  • cargo test -p yaak-templates — 92 unit tests and all doc tests passed
  • cargo check -p yaak-templates
  • cargo fmt -p yaak-templates -- --check
  • npm test
  • npm run lint — passed with two existing TypeScript warnings outside this change

Attribution

Implemented and verified with OpenAI Codex.

@github-actions github-actions Bot added the contribution: in scope Community PR appears to be in scope for maintainer review. label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Thanks for the PR. This appears to match Yaak's contribution policy and is awaiting review by @gschier.

This only means the PR is in scope for review. It does not mean the change has been reviewed or accepted for merge.

@github-actions
github-actions Bot requested a review from gschier August 3, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution: in scope Community PR appears to be in scope for maintainer review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant