From 0713212d1dcac6c1488cbb7feacbd940b7d82013 Mon Sep 17 00:00:00 2001 From: Usama Date: Mon, 9 Mar 2026 13:38:04 +0000 Subject: [PATCH 1/2] agentic chat add feature flag for frontend --- echo/frontend/.env.example | 4 +++ .../src/components/chat/ChatModeSelector.tsx | 25 +++++++++++-------- echo/frontend/src/config.ts | 2 ++ 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/echo/frontend/.env.example b/echo/frontend/.env.example index e1ddcdbd..b1904e72 100644 --- a/echo/frontend/.env.example +++ b/echo/frontend/.env.example @@ -7,6 +7,10 @@ VITE_ENABLE_CONVERSATION_HEALTH=0 # Set to "1" to enable webhook configuration in project settings VITE_ENABLE_WEBHOOKS=0 +# Agentic Chat Feature +# Set to "1" to enable the Agentic chat mode in the chat interface +VITE_ENABLE_AGENTIC_CHAT=0 + # Other environment variables can be found in src/config.ts # Examples: # VITE_USE_PARTICIPANT_ROUTER=1 diff --git a/echo/frontend/src/components/chat/ChatModeSelector.tsx b/echo/frontend/src/components/chat/ChatModeSelector.tsx index 070bffb9..ae528a9a 100644 --- a/echo/frontend/src/components/chat/ChatModeSelector.tsx +++ b/echo/frontend/src/components/chat/ChatModeSelector.tsx @@ -16,6 +16,7 @@ import { IconSparkles, } from "@tabler/icons-react"; import { useState } from "react"; +import { ENABLE_AGENTIC_CHAT } from "@/config"; import { analytics } from "@/lib/analytics"; import { AnalyticsEvents as events } from "@/lib/analyticsEvents"; import type { ChatMode } from "@/lib/api"; @@ -269,17 +270,19 @@ export const ChatModeSelector = ({ {/* Mode Cards */} - + {ENABLE_AGENTIC_CHAT && ( + + )} Date: Mon, 9 Mar 2026 13:47:58 +0000 Subject: [PATCH 2/2] agentic chat panel gaurd added for extra protection --- .../routes/project/chat/ProjectChatRoute.tsx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/echo/frontend/src/routes/project/chat/ProjectChatRoute.tsx b/echo/frontend/src/routes/project/chat/ProjectChatRoute.tsx index e45c1331..7e9728ab 100644 --- a/echo/frontend/src/routes/project/chat/ProjectChatRoute.tsx +++ b/echo/frontend/src/routes/project/chat/ProjectChatRoute.tsx @@ -24,11 +24,11 @@ import { import { useQueryClient } from "@tanstack/react-query"; import { useEffect, useMemo, useRef, useState } from "react"; import { useParams } from "react-router"; +import { AgenticChatPanel } from "@/components/chat/AgenticChatPanel"; import { ChatAccordionItemMenu, ChatModeIndicator, } from "@/components/chat/ChatAccordion"; -import { AgenticChatPanel } from "@/components/chat/AgenticChatPanel"; import { ChatContextProgress } from "@/components/chat/ChatContextProgress"; import { ChatHistoryMessage } from "@/components/chat/ChatHistoryMessage"; import { ChatMessage } from "@/components/chat/ChatMessage"; @@ -57,7 +57,11 @@ import { ScrollToBottomButton } from "@/components/common/ScrollToBottom"; import { toast } from "@/components/common/Toaster"; import { ConversationLinks } from "@/components/conversation/ConversationLinks"; import { useConversationsCountByProjectId } from "@/components/conversation/hooks"; -import { API_BASE_URL, ENABLE_CHAT_AUTO_SELECT } from "@/config"; +import { + API_BASE_URL, + ENABLE_AGENTIC_CHAT, + ENABLE_CHAT_AUTO_SELECT, +} from "@/config"; import { useElementOnScreen } from "@/hooks/useElementOnScreen"; import { useLanguage } from "@/hooks/useLanguage"; import { useLoadNotification } from "@/hooks/useLoadNotification"; @@ -498,8 +502,10 @@ export const ProjectChatRoute = () => { ); } - if (chatMode === "agentic") { - return ; + if (ENABLE_AGENTIC_CHAT && chatMode === "agentic") { + return ( + + ); } return ( @@ -791,9 +797,7 @@ export const ProjectChatRoute = () => { }} rightSection={} disabled={ - normalizedInput.trim() === "" || - isLoading || - isSubmitting + normalizedInput.trim() === "" || isLoading || isSubmitting } {...testId("chat-send-button")} >