From 1f4f583436d983de6341f3fd35c690890ca38276 Mon Sep 17 00:00:00 2001 From: Runix Date: Mon, 30 Nov 2026 17:26:29 +0530 Subject: [PATCH] AI Configuration: don't say ChatterMate AI on self-hosted installs The subtitle said agents already run on ChatterMate AI, which only hosted editions have. Self-hosted installs now get a neutral line, and a hosted org on its own model is no longer told it runs on ChatterMate AI. Signed-off-by: Runix --- .../components/ai/aiSetupSubtitle.spec.ts | 17 +++++++++++++++++ frontend/src/components/ai/AISetup.vue | 6 +++++- frontend/src/components/ai/aiSetupSubtitle.ts | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 frontend/src/__tests__/components/ai/aiSetupSubtitle.spec.ts create mode 100644 frontend/src/components/ai/aiSetupSubtitle.ts diff --git a/frontend/src/__tests__/components/ai/aiSetupSubtitle.spec.ts b/frontend/src/__tests__/components/ai/aiSetupSubtitle.spec.ts new file mode 100644 index 00000000..69ad7f37 --- /dev/null +++ b/frontend/src/__tests__/components/ai/aiSetupSubtitle.spec.ts @@ -0,0 +1,17 @@ +import { describe, expect, it } from 'vitest' +import { aiSetupSubtitle } from '@/components/ai/aiSetupSubtitle' + +describe('aiSetupSubtitle', () => { + it('never mentions ChatterMate AI on a self-hosted install', () => { + expect(aiSetupSubtitle(false, false)).not.toContain('ChatterMate AI') + expect(aiSetupSubtitle(false, true)).not.toContain('ChatterMate AI') + }) + + it('says hosted agents run on ChatterMate AI by default', () => { + expect(aiSetupSubtitle(true, false)).toContain('already run on ChatterMate AI') + }) + + it('does not claim ChatterMate AI once a hosted org saved its own model', () => { + expect(aiSetupSubtitle(true, true)).not.toContain('already run') + }) +}) diff --git a/frontend/src/components/ai/AISetup.vue b/frontend/src/components/ai/AISetup.vue index 6552d0c9..6e67a779 100644 --- a/frontend/src/components/ai/AISetup.vue +++ b/frontend/src/components/ai/AISetup.vue @@ -21,6 +21,7 @@ import { useEnterpriseFeatures } from '@/composables/useEnterpriseFeatures' import { useSubscriptionStorage } from '@/utils/storage' import { planDisplayName, planShortName } from '@/utils/planDisplay' import { useUpgradePlan } from '@/composables/useUpgradePlan' +import { aiSetupSubtitle } from './aiSetupSubtitle' const { upgradeText: lockUpgradeText } = useUpgradePlan('custom_models') @@ -361,6 +362,9 @@ const chatterMateButtonText = computed(() => { /** The saved setup already runs on ChatterMate AI: nothing to switch to. */ const usingChatterMate = computed(() => savedProvider.value === 'chattermate') + +const subtitle = computed(() => + aiSetupSubtitle(hasEnterpriseModule, hasExistingConfig.value && !usingChatterMate.value))