Class: PendingSubagentDecorator

Inherits:
PendingMessageDecorator show all
Defined in:
app/decorators/pending_subagent_decorator.rb

Overview

Decorates a subagent PendingMessage — a sub-agent’s reply that landed on the parent’s mailbox via SubagentMessageRouter. Promotes into a phantom from_<nickname> tool_call/tool_response pair, but while pending it surfaces as a labeled inbound delivery so the user sees which sub-agent is talking to her.

Hidden in basic (matches the promoted tool pair, which is hidden in basic). Visible from verbose with a [from <nickname>] badge.

Instance Method Summary collapse

Methods inherited from PendingMessageDecorator

#render

Instance Method Details

#render_basicnil

Returns sub-agent deliveries are hidden in basic mode.

Returns:

  • (nil)

    sub-agent deliveries are hidden in basic mode



13
14
15
# File 'app/decorators/pending_subagent_decorator.rb', line 13

def render_basic
  nil
end

#render_debugHash

Returns full sub-agent delivery payload.

Returns:

  • (Hash)

    full sub-agent delivery payload



28
29
30
31
32
33
34
35
# File 'app/decorators/pending_subagent_decorator.rb', line 28

def render_debug
  {
    role: :pending_subagent,
    source: source_name,
    content: content,
    status: "pending"
  }
end

#render_meleteString

Returns Melete transcript line.

Returns:

  • (String)

    Melete transcript line



38
39
40
# File 'app/decorators/pending_subagent_decorator.rb', line 38

def render_melete
  "Sub-agent #{source_name} (pending): #{truncate_middle(content)}"
end

#render_mnemeString

Returns Mneme transcript line.

Returns:

  • (String)

    Mneme transcript line



43
44
45
# File 'app/decorators/pending_subagent_decorator.rb', line 43

def render_mneme
  "Sub-agent #{source_name} (pending): #{truncate_middle(content)}"
end

#render_verboseHash

Returns dimmed sub-agent delivery payload.

Returns:

  • (Hash)

    dimmed sub-agent delivery payload



18
19
20
21
22
23
24
25
# File 'app/decorators/pending_subagent_decorator.rb', line 18

def render_verbose
  {
    role: :pending_subagent,
    source: source_name,
    content: truncate_lines(content, max_lines: 3),
    status: "pending"
  }
end