Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(routing): handle missing brain in BrainRedirect component

Steven Enamakel2c3108bbd855
diff --git a/app/src/components/routing/BrainRedirect.tsx b/app/src/components/routing/BrainRedirect.tsx
index 23a2832c8e..7285c7b47f 100644
--- a/app/src/components/routing/BrainRedirect.tsx
+++ b/app/src/components/routing/BrainRedirect.tsx
@@ -2,17 +2,21 @@ import { Navigate, useLocation } from 'react-router-dom';
/**
* Back-compat redirect for the retired top-level `/brain` page, which now lives
- * at Connections → Integrations → Brain (`/connections?tab=brain`).
+ * at Connections → Integrations → Memory (`/connections?tab=brain`).
*
* Brain used to own `?tab=` (graph|goals|sources|sync|welcome) and `?view=`.
* Connections owns `?tab=` now, so the old sub-tab moves to `?brain=`; every
- * other param (e.g. `view=history`) and the hash are carried over unchanged.
+ * other param (e.g. `view=history`) and the hash are carried over unchanged,
+ * after the canonical `tab`/`brain` pair.
*/
export default function BrainRedirect() {
const { search, hash } = useLocation();
- const params = new URLSearchParams(search);
- const legacyTab = params.get('tab');
- params.set('tab', 'brain');
+ const legacy = new URLSearchParams(search);
+ const params = new URLSearchParams({ tab: 'brain' });
+ const legacyTab = legacy.get('tab');
if (legacyTab) params.set('brain', legacyTab);
+ legacy.forEach((value, key) => {
+ if (key !== 'tab') params.append(key, value);
+ });
return <Navigate to={`/connections?${params.toString()}${hash}`} replace />;
}