From 3edfd35c8e1b991ae5a3d405a15747c6ece40f74 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sat, 21 Jun 2025 00:08:08 +0200 Subject: [PATCH 1/2] FIX: A typo in bot filtration in ai-bot-header-icon --- assets/javascripts/discourse/components/ai-bot-header-icon.gjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/components/ai-bot-header-icon.gjs b/assets/javascripts/discourse/components/ai-bot-header-icon.gjs index 4d5546c70..72b911fb3 100644 --- a/assets/javascripts/discourse/components/ai-bot-header-icon.gjs +++ b/assets/javascripts/discourse/components/ai-bot-header-icon.gjs @@ -20,7 +20,7 @@ export default class AiBotHeaderIcon extends Component { get bots() { const availableBots = this.currentUser.ai_enabled_chat_bots - .filter((bot) => !bot.is_persosna) + .filter((bot) => !bot.is_persona) .filter(Boolean); return availableBots ? availableBots.map((bot) => bot.model_name) : []; From 7ee1fd8b0cb2166685a91b05a712b71a05add2ea Mon Sep 17 00:00:00 2001 From: Roman Rizzi Date: Mon, 23 Jun 2025 15:23:51 -0300 Subject: [PATCH 2/2] FIX: Show header icon when there's only one persona with a default LLM set --- assets/javascripts/discourse/components/ai-bot-header-icon.gjs | 2 +- lib/ai_bot/entry_point.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/discourse/components/ai-bot-header-icon.gjs b/assets/javascripts/discourse/components/ai-bot-header-icon.gjs index 72b911fb3..92e898bc2 100644 --- a/assets/javascripts/discourse/components/ai-bot-header-icon.gjs +++ b/assets/javascripts/discourse/components/ai-bot-header-icon.gjs @@ -20,7 +20,7 @@ export default class AiBotHeaderIcon extends Component { get bots() { const availableBots = this.currentUser.ai_enabled_chat_bots - .filter((bot) => !bot.is_persona) + .filter((bot) => !bot.is_persona || bot.has_default_llm) .filter(Boolean); return availableBots ? availableBots.map((bot) => bot.model_name) : []; diff --git a/lib/ai_bot/entry_point.rb b/lib/ai_bot/entry_point.rb index 444baaa97..7bcdc646e 100644 --- a/lib/ai_bot/entry_point.rb +++ b/lib/ai_bot/entry_point.rb @@ -200,6 +200,7 @@ def inject_into(plugin) { "id" => persona_user[:user_id], "username" => persona_user[:username], + "has_default_llm" => persona_user[:default_llm_id].present?, "force_default_llm" => persona_user[:force_default_llm], "is_persona" => true, }