Services.SkillDepth (fnord v0.9.29)
View SourceTracks nested skill execution depth per process tree.
Skills can be configured to include the skills toolset tag, which gives them
access to the skill runner tool. This enables skill-to-skill calls.
To prevent runaway recursion, we track depth across nested calls and refuse execution once a maximum is reached.
Depth is scoped to the current process tree via Services.Globals, so
concurrent skill chains (e.g., parallel delegate steps) each maintain their
own independent counter.
Summary
Types
@type depth_result() :: {:ok, non_neg_integer()} | {:error, :max_depth_reached}
Functions
@spec dec_depth() :: {:ok, non_neg_integer()}
Decrement depth.
@spec depth() :: non_neg_integer()
Return current depth.
@spec inc_depth() :: depth_result()
Increment depth.
Returns {:error, :max_depth_reached} once the configured max is exceeded.