From b7a6bad7cdf2a807059b3929f49f9289c8842672 Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Tue, 27 May 2025 13:50:13 +0530 Subject: [PATCH] fix: minor bugs and route errors --- application/api/user/routes.py | 5 ++++- application/requirements.txt | 4 ++-- frontend/src/App.tsx | 6 ++++-- frontend/src/agents/SharedAgentGate.tsx | 7 +++++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 frontend/src/agents/SharedAgentGate.tsx diff --git a/application/api/user/routes.py b/application/api/user/routes.py index ae653c39..60277132 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -1500,7 +1500,10 @@ class PinnedAgents(Resource): "description": agent.get("description", ""), "source": ( str(db.dereference(agent["source"])["_id"]) - if "source" in agent and isinstance(agent["source"], DBRef) + if "source" in agent + and agent["source"] + and isinstance(agent["source"], DBRef) + and db.dereference(agent["source"]) is not None else "" ), "chunks": agent.get("chunks", ""), diff --git a/application/requirements.txt b/application/requirements.txt index 3891c852..3778d941 100644 --- a/application/requirements.txt +++ b/application/requirements.txt @@ -46,7 +46,7 @@ pandas==2.2.3 openpyxl==3.1.5 pathable==0.4.4 pillow==11.1.0 -portalocker==3.1.1 +portalocker>=2.7.0,<3.0.0 prance==23.6.21.0 prompt-toolkit==3.0.51 protobuf==5.29.3 @@ -62,7 +62,7 @@ python-dotenv==1.0.1 python-jose==3.4.0 python-pptx==1.0.2 redis==5.2.1 -referencing==0.36.2 +referencing>=0.28.0,<0.31.0 regex==2024.11.6 requests==2.32.3 retry==0.9.2 diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 1bba5f44..b3604c46 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -4,6 +4,9 @@ import { useState } from 'react'; import { Outlet, Route, Routes } from 'react-router-dom'; import About from './About'; +import Agents from './agents'; +import SharedAgentGate from './agents/SharedAgentGate'; +import ActionButtons from './components/ActionButtons'; import Spinner from './components/Spinner'; import Conversation from './conversation/Conversation'; import { SharedConversation } from './conversation/SharedConversation'; @@ -12,8 +15,6 @@ import useTokenAuth from './hooks/useTokenAuth'; import Navigation from './Navigation'; import PageNotFound from './PageNotFound'; import Setting from './settings'; -import Agents from './agents'; -import ActionButtons from './components/ActionButtons'; function AuthWrapper({ children }: { children: React.ReactNode }) { const { isAuthLoading } = useTokenAuth(); @@ -69,6 +70,7 @@ export default function App() { } /> } /> + } /> } /> diff --git a/frontend/src/agents/SharedAgentGate.tsx b/frontend/src/agents/SharedAgentGate.tsx new file mode 100644 index 00000000..877b6b1f --- /dev/null +++ b/frontend/src/agents/SharedAgentGate.tsx @@ -0,0 +1,7 @@ +import { Navigate, useParams } from 'react-router-dom'; + +export default function SharedAgentGate() { + const { agentId } = useParams(); + + return ; +}