What happened?
src/infrastructure/yaml-pack-loader.ts:209-214 accepts any BeforeToolAction (including another confirm) as a fallback. The validator accepts it, the types allow it (src/core/types.ts:19), and the resolver recurses on the fallback (src/resolver/action-resolver.ts:144).
A YAML rule like the following, evaluated with capabilities.confirm: false, will infinite-recurse and stack-overflow:
defaultAction:
type: confirm
fallback:
type: confirm
fallback:
type: confirm
fallback:
type: confirm
# ... ad infinitum
There is no depth limit in the loader, validator, or resolver.
What did you expect to happen?
The loader or resolver should reject (or break out of) recursive fallback chains beyond a reasonable depth (e.g. 5), or at minimum not stack-overflow on a malformed/unbounded chain.
Steps to reproduce
- Create a YAML rule pack with a
confirm action whose fallback is itself a confirm with another confirm fallback (≥ a few levels deep)
- Load it with
loadYamlRulePack
- Evaluate with
capabilities.confirm: false
- Observe
RangeError: Maximum call stack size exceeded in resolveAction
What happened?
src/infrastructure/yaml-pack-loader.ts:209-214accepts anyBeforeToolAction(including anotherconfirm) as afallback. The validator accepts it, the types allow it (src/core/types.ts:19), and the resolver recurses on the fallback (src/resolver/action-resolver.ts:144).A YAML rule like the following, evaluated with
capabilities.confirm: false, will infinite-recurse and stack-overflow:There is no depth limit in the loader, validator, or resolver.
What did you expect to happen?
The loader or resolver should reject (or break out of) recursive
fallbackchains beyond a reasonable depth (e.g. 5), or at minimum not stack-overflow on a malformed/unbounded chain.Steps to reproduce
confirmaction whosefallbackis itself aconfirmwith anotherconfirmfallback (≥ a few levels deep)loadYamlRulePackcapabilities.confirm: falseRangeError: Maximum call stack size exceededinresolveAction