diff --git a/site/src/pages/AgentsPage/AgentSettingsPage.tsx b/site/src/pages/AgentsPage/AgentSettingsPage.tsx
index 11199f2d82..d2f12d4323 100644
--- a/site/src/pages/AgentsPage/AgentSettingsPage.tsx
+++ b/site/src/pages/AgentsPage/AgentSettingsPage.tsx
@@ -1,9 +1,11 @@
import type { FC } from "react";
-import { Outlet, useParams } from "react-router";
+import { Outlet, useLocation } from "react-router";
import { AgentPageHeader } from "./components/AgentPageHeader";
const AgentSettingsPage: FC = () => {
- const { "*": section } = useParams();
+ const location = useLocation();
+ const match = location.pathname.match(/\/agents\/settings\/(.+)/);
+ const section = match?.[1];
return (
<>
diff --git a/site/src/router.tsx b/site/src/router.tsx
index a04846e055..03ea217052 100644
--- a/site/src/router.tsx
+++ b/site/src/router.tsx
@@ -696,7 +696,7 @@ export const router = createBrowserRouter(
>
} />
}>
- } />
+ } />
} />
} />
} />