diff --git a/ui/src/components/SidebarAgents.tsx b/ui/src/components/SidebarAgents.tsx index 5b438f0a..0b34f3a0 100644 --- a/ui/src/components/SidebarAgents.tsx +++ b/ui/src/components/SidebarAgents.tsx @@ -74,8 +74,12 @@ export function SidebarAgents() { return sortByHierarchy(filtered); }, [agents]); - const agentMatch = location.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)/); + const agentMatch = location.pathname.match(/^\/(?:[^/]+\/)?agents\/([^/]+)(?:\/([^/]+))?/); const activeAgentId = agentMatch?.[1] ?? null; + const activeTab = agentMatch?.[2] ?? null; + + // Valid agent detail tabs — preserve across agent switches + const validTabs = new Set(["dashboard", "prompts", "skills", "configuration", "configure", "budget", "runs"]); return ( @@ -112,7 +116,7 @@ export function SidebarAgents() { return ( { if (isMobile) setSidebarOpen(false); }}