Exception: Phronomy::Agent::SuspendSignal Private

Inherits:
StandardError
  • Object
show all
Defined in:
lib/phronomy/agent/suspend_signal.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Raised internally inside the on_tool_call hook when an approval-required tool is encountered and no synchronous on_approval_required handler has been registered. Caught by Agent::Base#invoke_once to produce a suspended result hash containing a Checkpoint.

This class is intentionally NOT part of the public API. Callers should inspect the +:suspended+ key in the result hash returned by #invoke.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool_name:, args:, tool_call_id:) ⇒ SuspendSignal

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SuspendSignal.

Parameters:

  • tool_name (String)
  • args (Hash)
  • tool_call_id (String)


27
28
29
30
31
32
# File 'lib/phronomy/agent/suspend_signal.rb', line 27

def initialize(tool_name:, args:, tool_call_id:)
  super("Agent suspended waiting for approval of tool: #{tool_name}")
  @tool_name = tool_name
  @args = args
  @tool_call_id = tool_call_id
end

Instance Attribute Details

#argsHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the arguments the LLM passed to the tool.

Returns:

  • (Hash)

    the arguments the LLM passed to the tool



19
20
21
# File 'lib/phronomy/agent/suspend_signal.rb', line 19

def args
  @args
end

#tool_call_idString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the tool_call_id from the LLM response.

Returns:

  • (String)

    the tool_call_id from the LLM response



22
23
24
# File 'lib/phronomy/agent/suspend_signal.rb', line 22

def tool_call_id
  @tool_call_id
end

#tool_nameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the name of the tool that triggered the suspension.

Returns:

  • (String)

    the name of the tool that triggered the suspension



16
17
18
# File 'lib/phronomy/agent/suspend_signal.rb', line 16

def tool_name
  @tool_name
end