6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/legion/task_outcome_observer.rb', line 6
def setup
return unless enabled?
Legion::Events.on('task.completed') do |payload|
handle_outcome(payload, success: true)
end
Legion::Events.on('task.failed') do |payload|
handle_outcome(payload, success: false)
end
setup_llm_reflection_hook
Legion::Logging.info '[TaskOutcomeObserver] wired to task.completed and task.failed'
rescue StandardError => e
Legion::Logging.warn "[TaskOutcomeObserver] setup failed: #{e.message}" if defined?(Legion::Logging)
end
|