Skip to content

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): suppress Sentry noise from expected 401s in OnboardingProvider (#12708)

Zamil Majdycab061a12dcd
diff --git a/autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx b/autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx
index 90dfa6e106..89518bce2b 100644
--- a/autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx
+++ b/autogpt_platform/frontend/src/providers/onboarding/onboarding-provider.tsx
@@ -19,6 +19,7 @@ import {
import { useToast } from "@/components/molecules/Toast/use-toast";
import { useOnboardingTimezoneDetection } from "@/hooks/useOnboardingTimezoneDetection";
import {
+ ApiError,
UserOnboarding,
WebSocketNotification,
} from "@/lib/autogpt-server-api";
@@ -164,6 +165,11 @@ export default function OnboardingProvider({
router.replace("/copilot");
}
} catch (error) {
+ if (error instanceof ApiError && error.status === 401) {
+ hasInitialized.current = false;
+ return;
+ }
+
console.error("Failed to initialize onboarding:", error);
toast({