AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend): remove double flag check on homepage redirect (#11894)
Ottoe10ff8d37fb5
diff --git a/autogpt_platform/frontend/src/app/page.tsx b/autogpt_platform/frontend/src/app/page.tsxindex 31d1e96e48..9a55e986bc 100644--- a/autogpt_platform/frontend/src/app/page.tsx+++ b/autogpt_platform/frontend/src/app/page.tsx@@ -1,14 +1,20 @@"use client";-import { FeatureFlagRedirect } from "@/services/feature-flags/FeatureFlagRedirect";-import { Flag } from "@/services/feature-flags/use-get-flag";+import { useRouter } from "next/navigation";+import { useEffect } from "react";+/**+ * Root page always redirects to /copilot.+ * The /copilot page handles the feature flag check and redirects to /library if needed.+ * This single-check approach avoids race conditions with LaunchDarkly initialization.+ * See: SECRT-1845+ */export default function Page() {- return (- <FeatureFlagRedirect- flag={Flag.CHAT}- whenEnabled="/copilot"- whenDisabled="/library"- />- );+ const router = useRouter();++ useEffect(() => {+ router.replace("/copilot");+ }, [router]);++ return null;}