Class: Events::StartProcessing

Inherits:
Object
  • Object
show all
Defined in:
lib/events/start_processing.rb

Overview

Emitted when an active PendingMessage lands on an idle session and does not require the Melete/Mneme enrichment pipeline (tool calls, tool responses, sub-agent replies), or when MeleteEnrichmentJob finishes without a goal change, or when MnemeEnrichmentJob finishes recall. The drain loop subscribes and begins processing the mailbox.

Final stage of the start_melete → (start_mneme) → start_processing chain.

Constant Summary collapse

TYPE =
"session.start_processing"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_id:, pending_message_id: nil) ⇒ StartProcessing

Returns a new instance of StartProcessing.

Parameters:

  • session_id (Integer)

    session whose drain loop should start

  • pending_message_id (Integer, nil) (defaults to: nil)

    the PendingMessage that triggered the chain, if any



19
20
21
22
# File 'lib/events/start_processing.rb', line 19

def initialize(session_id:, pending_message_id: nil)
  @session_id = session_id
  @pending_message_id = pending_message_id
end

Instance Attribute Details

#pending_message_idObject (readonly)

Returns the value of attribute pending_message_id.



15
16
17
# File 'lib/events/start_processing.rb', line 15

def pending_message_id
  @pending_message_id
end

#session_idObject (readonly)

Returns the value of attribute session_id.



15
16
17
# File 'lib/events/start_processing.rb', line 15

def session_id
  @session_id
end

Instance Method Details

#event_nameObject



24
25
26
# File 'lib/events/start_processing.rb', line 24

def event_name
  "#{Bus::NAMESPACE}.#{TYPE}"
end

#to_hObject



28
29
30
# File 'lib/events/start_processing.rb', line 28

def to_h
  {type: TYPE, session_id:, pending_message_id:}
end