47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/legion/cli/chat/tools/manage_tasks.rb', line 47
def execute(action:, **)
action = action.to_s.strip
return "Invalid action: #{action}. Use: #{VALID_ACTIONS.join(', ')}" unless VALID_ACTIONS.include?(action)
send(:"handle_#{action}", **)
rescue Errno::ECONNREFUSED
'Legion daemon not running (cannot reach task API).'
rescue StandardError => e
Legion::Logging.warn("ManageTasks#execute failed: #{e.message}") if defined?(Legion::Logging)
"Error managing tasks: #{e.message}"
end
|