Skip to content

The open-source app everyone uses to manage agents at work

Preserve active tab when switching agents in sidebar

dottaf98d8212139a
diff --git a/ui/src/components/SidebarAgents.tsx b/ui/src/components/SidebarAgents.tsx
index 5b438f0ae7..0b34f3a025 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 (
<Collapsible open={open} onOpenChange={setOpen}>
@@ -112,7 +116,7 @@ export function SidebarAgents() {
return (
<NavLink
key={agent.id}
- to={agentUrl(agent)}
+ to={activeTab && validTabs.has(activeTab) ? `${agentUrl(agent)}/${activeTab}` : agentUrl(agent)}
onClick={() => {
if (isMobile) setSidebarOpen(false);
}}