Services.SkillDepth (fnord v0.9.29)

View Source

Tracks 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

Functions

Decrement depth.

Return current depth.

Increment depth.

Types

depth_result()

@type depth_result() :: {:ok, non_neg_integer()} | {:error, :max_depth_reached}

Functions

dec_depth()

@spec dec_depth() :: {:ok, non_neg_integer()}

Decrement depth.

depth()

@spec depth() :: non_neg_integer()

Return current depth.

inc_depth()

@spec inc_depth() :: depth_result()

Increment depth.

Returns {:error, :max_depth_reached} once the configured max is exceeded.