Class: PendingToolResponseDecorator
- Inherits:
-
PendingMessageDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- PendingMessageDecorator
- PendingToolResponseDecorator
- Defined in:
- app/decorators/pending_tool_response_decorator.rb
Overview
Decorates a tool_response PendingMessage — a tool result waiting in the mailbox before the drain pairs it with its tool_call and feeds the next LLM turn. Mirrors ToolResponseDecorator: hidden in basic (aggregated by the tool counter), structured tool output in verbose, full untruncated content in debug — all dimmed via status: “pending”.
Instance Method Summary collapse
-
#render_basic ⇒ nil
Tool responses are hidden in basic mode.
-
#render_debug ⇒ Hash
Full tool response payload tagged as pending.
-
#render_melete ⇒ String
Melete transcript line.
-
#render_mneme ⇒ String
Mneme transcript line.
-
#render_verbose ⇒ Hash
Truncated tool response payload tagged as pending.
Methods inherited from PendingMessageDecorator
Instance Method Details
#render_basic ⇒ nil
Returns tool responses are hidden in basic mode.
11 12 13 |
# File 'app/decorators/pending_tool_response_decorator.rb', line 11 def render_basic nil end |
#render_debug ⇒ Hash
Returns full tool response payload tagged as pending.
31 32 33 34 35 36 37 38 39 40 |
# File 'app/decorators/pending_tool_response_decorator.rb', line 31 def render_debug { role: :tool_response, tool: source_name, content: content, success: success != false, tool_use_id: tool_use_id, status: "pending" } end |
#render_melete ⇒ String
Returns Melete transcript line.
43 44 45 |
# File 'app/decorators/pending_tool_response_decorator.rb', line 43 def render_melete "tool_response #{tool_use_id} (pending): #{truncate_middle(content)}" end |
#render_mneme ⇒ String
Returns Mneme transcript line.
48 49 50 |
# File 'app/decorators/pending_tool_response_decorator.rb', line 48 def render_mneme "tool_response #{tool_use_id} (pending): #{truncate_middle(content)}" end |
#render_verbose ⇒ Hash
Returns truncated tool response payload tagged as pending.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/decorators/pending_tool_response_decorator.rb', line 16 def render_verbose { role: :tool_response, tool: source_name, content: truncate_lines(content, max_lines: 3), # nil treated as success; only an explicit false flips the indicator # — mirrors {ToolResponseDecorator}'s convention so legacy PMs # without an explicit success column don't render as failures. success: success != false, tool_use_id: tool_use_id, status: "pending" } end |