From 5735f063a3978a8e4864c81485393d3d4dc2e8ea Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 24 Jun 2025 15:51:07 +0200 Subject: [PATCH] FIX: A typo in bot filtration in ai-bot-header-icon (#1455) * FIX: A typo in bot filtration in ai-bot-header-icon * FIX: Show header icon when there's only one persona with a default LLM set --------- Co-authored-by: Roman Rizzi --- 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 4d5546c7..92e898bc 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 || 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 444baaa9..7bcdc646 100644 --- a/lib/ai_bot/entry_point.rb +++ b/lib/ai_bot/entry_point.rb @@ -200,6 +200,7 @@ module DiscourseAi { "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, }