Skip to content

Commit 9f1dcbd

Browse files
authored
ECHO-708 agentic chat add feature flag for frontend (#471)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a configurable toggle to enable or disable Agentic Chat availability. * The Agentic Chat option in the mode selector is hidden when disabled, and the chat route falls back to the main chat UI. * Administrators can control Agentic Chat visibility via deployment configuration. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 6128386 commit 9f1dcbd

4 files changed

Lines changed: 31 additions & 18 deletions

File tree

echo/frontend/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ VITE_ENABLE_CONVERSATION_HEALTH=0
77
# Set to "1" to enable webhook configuration in project settings
88
VITE_ENABLE_WEBHOOKS=0
99

10+
# Agentic Chat Feature
11+
# Set to "1" to enable the Agentic chat mode in the chat interface
12+
VITE_ENABLE_AGENTIC_CHAT=0
13+
1014
# Other environment variables can be found in src/config.ts
1115
# Examples:
1216
# VITE_USE_PARTICIPANT_ROUTER=1

echo/frontend/src/components/chat/ChatModeSelector.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
IconSparkles,
1717
} from "@tabler/icons-react";
1818
import { useState } from "react";
19+
import { ENABLE_AGENTIC_CHAT } from "@/config";
1920
import { analytics } from "@/lib/analytics";
2021
import { AnalyticsEvents as events } from "@/lib/analyticsEvents";
2122
import type { ChatMode } from "@/lib/api";
@@ -269,17 +270,19 @@ export const ChatModeSelector = ({
269270

270271
{/* Mode Cards */}
271272
<Stack gap="lg">
272-
<ModeCard
273-
mode="agentic"
274-
title={t`Agentic`}
275-
subtitle={t`Delegate multi-step analysis with live tool execution`}
276-
examples={getAgenticExamples()}
277-
icon={IconSparkles}
278-
isBeta
279-
selectedMode={selectedMode}
280-
isLoading={isLoading}
281-
onSelectMode={handleSelectMode}
282-
/>
273+
{ENABLE_AGENTIC_CHAT && (
274+
<ModeCard
275+
mode="agentic"
276+
title={t`Agentic`}
277+
subtitle={t`Delegate multi-step analysis with live tool execution`}
278+
examples={getAgenticExamples()}
279+
icon={IconSparkles}
280+
isBeta
281+
selectedMode={selectedMode}
282+
isLoading={isLoading}
283+
onSelectMode={handleSelectMode}
284+
/>
285+
)}
283286

284287
<ModeCard
285288
mode="deep_dive"

echo/frontend/src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ export const ENABLE_CONVERSATION_HEALTH = true;
4646
export const ENABLE_ANNOUNCEMENTS = true;
4747
export const ENABLE_DISPLAY_CONVERSATION_LINKS = true;
4848
export const ENABLE_WEBHOOKS = true;
49+
export const ENABLE_AGENTIC_CHAT =
50+
import.meta.env.VITE_ENABLE_AGENTIC_CHAT === "1";

echo/frontend/src/routes/project/chat/ProjectChatRoute.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import {
2424
import { useQueryClient } from "@tanstack/react-query";
2525
import { useEffect, useMemo, useRef, useState } from "react";
2626
import { useParams } from "react-router";
27+
import { AgenticChatPanel } from "@/components/chat/AgenticChatPanel";
2728
import {
2829
ChatAccordionItemMenu,
2930
ChatModeIndicator,
3031
} from "@/components/chat/ChatAccordion";
31-
import { AgenticChatPanel } from "@/components/chat/AgenticChatPanel";
3232
import { ChatContextProgress } from "@/components/chat/ChatContextProgress";
3333
import { ChatHistoryMessage } from "@/components/chat/ChatHistoryMessage";
3434
import { ChatMessage } from "@/components/chat/ChatMessage";
@@ -57,7 +57,11 @@ import { ScrollToBottomButton } from "@/components/common/ScrollToBottom";
5757
import { toast } from "@/components/common/Toaster";
5858
import { ConversationLinks } from "@/components/conversation/ConversationLinks";
5959
import { useConversationsCountByProjectId } from "@/components/conversation/hooks";
60-
import { API_BASE_URL, ENABLE_CHAT_AUTO_SELECT } from "@/config";
60+
import {
61+
API_BASE_URL,
62+
ENABLE_AGENTIC_CHAT,
63+
ENABLE_CHAT_AUTO_SELECT,
64+
} from "@/config";
6165
import { useElementOnScreen } from "@/hooks/useElementOnScreen";
6266
import { useLanguage } from "@/hooks/useLanguage";
6367
import { useLoadNotification } from "@/hooks/useLoadNotification";
@@ -498,8 +502,10 @@ export const ProjectChatRoute = () => {
498502
);
499503
}
500504

501-
if (chatMode === "agentic") {
502-
return <AgenticChatPanel chatId={chatId ?? ""} projectId={projectId ?? ""} />;
505+
if (ENABLE_AGENTIC_CHAT && chatMode === "agentic") {
506+
return (
507+
<AgenticChatPanel chatId={chatId ?? ""} projectId={projectId ?? ""} />
508+
);
503509
}
504510

505511
return (
@@ -791,9 +797,7 @@ export const ProjectChatRoute = () => {
791797
}}
792798
rightSection={<IconSend size={24} />}
793799
disabled={
794-
normalizedInput.trim() === "" ||
795-
isLoading ||
796-
isSubmitting
800+
normalizedInput.trim() === "" || isLoading || isSubmitting
797801
}
798802
{...testId("chat-send-button")}
799803
>

0 commit comments

Comments
 (0)