Skip to content

Commit c3ecde0

Browse files
committed
Allow chatbot when VITE_AI_BASE_URL is explicitly configured
1 parent f63f731 commit c3ecde0

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

packages/app-shell/src/console/home/HomeLayout.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ interface HomeLayoutProps {
2424
export function HomeLayout({ children }: HomeLayoutProps) {
2525
const { setContext } = useNavigationContext();
2626
const { isAiEnabled } = useDiscovery();
27+
// Render the chatbot whenever AI is reachable. If the developer has explicitly
28+
// configured `VITE_AI_BASE_URL`, trust that opt-in even when discovery
29+
// reports AI as disabled (e.g. framework started without `--preset full`).
30+
const aiBaseUrlConfigured = Boolean(import.meta.env?.VITE_AI_BASE_URL);
31+
const showChatbot = isAiEnabled || aiBaseUrlConfigured;
2732

2833
useEffect(() => {
2934
setContext('home');
@@ -39,7 +44,7 @@ export function HomeLayout({ children }: HomeLayoutProps) {
3944
</main>
4045

4146
{/* Global floating chatbot — also available on the home/workspace screen */}
42-
{isAiEnabled && (
47+
{showChatbot && (
4348
<Suspense fallback={null}>
4449
<ConsoleFloatingChatbot appLabel="Workspace" objects={[]} />
4550
</Suspense>

packages/app-shell/src/layout/ConsoleLayout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export function ConsoleLayout({
5656
}: ConsoleLayoutProps) {
5757
const appLabel = resolveI18nLabel(activeApp?.label) || activeAppName;
5858
const { isAiEnabled } = useDiscovery();
59+
// Trust an explicit `VITE_AI_BASE_URL` opt-in even when discovery reports
60+
// AI as disabled (e.g. framework started without `--preset full`).
61+
const aiBaseUrlConfigured = Boolean(import.meta.env?.VITE_AI_BASE_URL);
62+
const showChatbot = isAiEnabled || aiBaseUrlConfigured;
5963
const { setContext, setCurrentAppName } = useNavigationContext();
6064

6165
// Set navigation context to 'app' when this layout mounts
@@ -101,8 +105,9 @@ export function ConsoleLayout({
101105
{children}
102106
</ConsoleLayoutInner>
103107

104-
{/* Global floating chatbot — rendered only when AI service is available */}
105-
{isAiEnabled && (
108+
{/* Global floating chatbot — rendered when AI service is available
109+
OR when `VITE_AI_BASE_URL` has been explicitly configured. */}
110+
{showChatbot && (
106111
<Suspense fallback={null}>
107112
<ConsoleFloatingChatbot appLabel={appLabel} objects={objects} />
108113
</Suspense>

0 commit comments

Comments
 (0)