Skip to content

A platform for community discussion. Free, open, simple.

FIX: retrying a bot reply with no stored agent raises NoMethodError (#44038)

Ary Rabelo3ccc9c5a2d48
diff --git a/plugins/discourse-ai/app/controllers/discourse_ai/ai_bot/bot_controller.rb b/plugins/discourse-ai/app/controllers/discourse_ai/ai_bot/bot_controller.rb
index 2b9c9d529ce..25f969e2ae2 100644
--- a/plugins/discourse-ai/app/controllers/discourse_ai/ai_bot/bot_controller.rb
+++ b/plugins/discourse-ai/app/controllers/discourse_ai/ai_bot/bot_controller.rb
@@ -134,7 +134,7 @@ module DiscourseAi
agent_id = AiAgent.find_by(name: agent_name)&.id if agent_name.present?
end
- agent_id ||= DiscourseAi::Agents::General.id
+ agent_id ||= DiscourseAi::Agents::Agent.system_agents[DiscourseAi::Agents::General]
agent_id.to_i
end
end