-
Notifications
You must be signed in to change notification settings - Fork 19
ECHO-708 agentic chat add feature flag for frontend #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 <AgenticChatPanel chatId={chatId ?? ""} projectId={projectId ?? ""} />; | ||
| if (ENABLE_AGENTIC_CHAT && chatMode === "agentic") { | ||
| return ( | ||
| <AgenticChatPanel chatId={chatId ?? ""} projectId={projectId ?? ""} /> | ||
| ); | ||
| } | ||
|
Comment on lines
+505
to
509
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for agentic mode validation in backend chat endpoints
rg -n -C3 'agentic' --type pyRepository: Dembrane/echo Length of output: 50369 🏁 Script executed: # Search for ENABLE_AGENTIC_CHAT in frontend
rg -n "ENABLE_AGENTIC_CHAT" echo/frontend/src --type ts --type tsxRepository: Dembrane/echo Length of output: 84 🏁 Script executed: # Look at ProjectChatRoute.tsx around the mentioned lines
fd "ProjectChatRoute.tsx" echo/frontend/src --exec head -550 {} \; --exec tail -100 {} \;Repository: Dembrane/echo Length of output: 18767 🏁 Script executed: # Search for shouldFetchSuggestions and ChatModeIndicator
rg -n "shouldFetchSuggestions|ChatModeIndicator" echo/frontend/src --type ts --type tsx -A 2Repository: Dembrane/echo Length of output: 84 🏁 Script executed: # Search for ChatModeSelector to understand mode reset flow
rg -n "ChatModeSelector" echo/frontend/src --type ts --context 3Repository: Dembrane/echo Length of output: 8938 🏁 Script executed: # Check if there's any ENABLE_AGENTIC_CHAT config definition and usage
rg -n "ENABLE_AGENTIC_CHAT" echo/frontend --type ts --context 2Repository: Dembrane/echo Length of output: 2151 🏁 Script executed: # Look for any fallback or error handling for disabled agentic mode
rg -n "agentic" echo/frontend/src/routes/project/chat/ProjectChatRoute -A 3 -B 3Repository: Dembrane/echo Length of output: 151 🏁 Script executed: # Final check: verify ChatModeSelector properly filters agentic option
rg -n "ENABLE_AGENTIC_CHAT" echo/frontend/src/components/chat/ChatModeSelector.tsx -A 5 -B 2Repository: Dembrane/echo Length of output: 734 Add fallback when agentic flag disabled but mode persists in DB When The proposed approach—showing the Suggested implementation- if (ENABLE_AGENTIC_CHAT && chatMode === "agentic") {
+ if (chatMode === "agentic") {
+ if (!ENABLE_AGENTIC_CHAT) {
+ // Agentic mode disabled - treat as unselected to let user re-pick
+ return (
+ <Box className="flex min-h-full items-center justify-center px-2 pr-4">
+ <ChatModeSelector
+ chatId={chatId ?? ""}
+ projectId={projectId ?? ""}
+ onModeSelected={async (mode) => {
+ if (chatId && mode === "overview") {
+ prefetchSuggestions(chatId, language, 5000);
+ }
+ chatContextQuery.refetch();
+ }}
+ />
+ </Box>
+ );
+ }
return (
<AgenticChatPanel chatId={chatId ?? ""} projectId={projectId ?? ""} />
);
}🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not applicable...the feature hasn't shipped yet, so no chats with chat_mode = "agentic" exist in any database.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
🧠 Learnings used |
||
|
|
||
| return ( | ||
|
|
@@ -791,9 +797,7 @@ export const ProjectChatRoute = () => { | |
| }} | ||
| rightSection={<IconSend size={24} />} | ||
| disabled={ | ||
| normalizedInput.trim() === "" || | ||
| isLoading || | ||
| isSubmitting | ||
| normalizedInput.trim() === "" || isLoading || isSubmitting | ||
| } | ||
| {...testId("chat-send-button")} | ||
| > | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.