Exception: Parse::Agent::RecursionLimitExceeded
- Inherits:
-
AgentError
- Object
- StandardError
- AgentError
- Parse::Agent::RecursionLimitExceeded
- Defined in:
- lib/parse/agent/errors.rb
Overview
Raised at construction when an agent built with ‘parent:` would exceed the inherited recursion depth budget. Defends against delegate_to_subagent (or any tool that constructs a Parse::Agent inside its handler) recursing without bound.
The budget is decremented on every inherited construction; the zero-floor agent can still execute its own tools, but constructing another sub-agent with ‘parent: zero_floor_agent` raises this error.
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
Instance Method Summary collapse
-
#initialize(message = nil, depth: nil) ⇒ RecursionLimitExceeded
constructor
A new instance of RecursionLimitExceeded.
Constructor Details
#initialize(message = nil, depth: nil) ⇒ RecursionLimitExceeded
Returns a new instance of RecursionLimitExceeded.
116 117 118 119 120 121 |
# File 'lib/parse/agent/errors.rb', line 116 def initialize( = nil, depth: nil) @depth = depth super( || "Parse::Agent recursion depth exhausted (depth=#{depth.inspect}). " \ "A sub-agent attempted to construct another sub-agent past the " \ "configured recursion_depth: cap.") end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
114 115 116 |
# File 'lib/parse/agent/errors.rb', line 114 def depth @depth end |