#1688·conductor

ParametersUtils: cap the nesting depth of ${...} expressions

Author: Naman-GururaniCreated Sep 25, 2026Updated Sep 28, 2026
Labelsbug

Follow-up to #1654, from @nthmost-orkes's review there: nested ${...} expressions are evaluated recursively, one level per ${, so input nested deeply enough fails with a StackOverflowError. Each level also keeps its own copy of the rest of the string, so it can run out of heap before that: ${ nested 100,000 deep (a ~300 KB string, e.g. in task output from a worker) hit OutOfMemoryError: Java heap space in a test JVM in about 2 seconds.

Proposal: cap the nesting at a fixed depth, say 32 (real templates nest a couple of levels), and resolve anything deeper to null with a warning, the same as a path that can't be read today. Nothing that resolves now changes, and no new exception reaches the decider or event handlers.

I have it working locally with tests (the boundary at the limit, and the 100,000-deep input now finishing in ~0.1 s), and the full conductor-core suite passes. Does this sound good, or would you prefer a different limit, or failing the task instead of resolving to null?