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): keep hosted-only UI out of self-hosted installs (#15408)
Nicholas Tindle2613c7d4114a
diff --git a/autogpt_platform/frontend/public/emoji/1f4a4.svg b/autogpt_platform/frontend/public/emoji/1f4a4.svgnew file mode 100644index 0000000000..b713e97a60--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/1f4a4.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#4289C1" d="M33 19c1.187 0 2 .786 2 2 0 1.073-.983 2-2 2H22c-1.496 0-2-.813-2-2 0-.565.632-1.492 1-2l8-12h-7c-1.128 0-2-.843-2-2 0-1.073.929-2 2-2h11c1.639 0 2 1.012 2 2 0 .621-.635 1.519-1 2l-8 12h7zm-16 5c.633 0 1 .353 1 1 0 .573-.458 1-1 1h-6c-.798 0-1-.367-1-1 0-.301.337-.729.533-1L15 18h-4c-.602 0-1-.384-1-1 0-.573.428-1 1-1h6c.874 0 1 .473 1 1 0 .331-.338.877-.533 1.133L13 24h4zm-9 7c.633 0 1 .353 1 1 0 .573-.458 1-1 1H2c-.798 0-1-.367-1-1 0-.301.337-.729.533-1L6 25H2c-.602 0-1-.384-1-1 0-.572.428-1 1-1h6c.874 0 1 .473 1 1 0 .331-.338.877-.533 1.133L4 31h4z"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/1f4b5.svg b/autogpt_platform/frontend/public/emoji/1f4b5.svgnew file mode 100644index 0000000000..1c68944afa--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/1f4b5.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#5C913B" d="M2 11c-2 0-2 2-2 2v21s0 2 2 2h32c2 0 2-2 2-2V13s0-2-2-2H2z"/><path fill="#A7D28B" d="M2 6C0 6 0 8 0 8v20s0 2 2 2h32c2 0 2-2 2-2V8s0-2-2-2H2z"/><circle fill="#77B255" cx="25" cy="18" r="6.5"/><path fill="#5C913B" d="M33 28.5H3c-.827 0-1.5-.673-1.5-1.5V9c0-.827.673-1.5 1.5-1.5h30c.827 0 1.5.673 1.5 1.5v18c0 .827-.673 1.5-1.5 1.5zM3 8.5c-.275 0-.5.224-.5.5v18c0 .275.225.5.5.5h30c.275 0 .5-.225.5-.5V9c0-.276-.225-.5-.5-.5H3z"/><path fill="#FFE8B6" d="M14 6h8v24.062h-8z"/><path fill="#FFAC33" d="M14 30h8v6h-8z"/><path fill="#5C913B" d="M11.81 20.023c0-2.979-5.493-2.785-5.493-4.584 0-.871.833-1.296 1.799-1.296 1.625 0 1.914 1.044 2.65 1.044.521 0 .772-.328.772-.696 0-.856-1.296-1.502-2.539-1.726v-.825c0-.515-.417-.932-.932-.932s-.932.418-.932.932v.853c-1.354.31-2.521 1.25-2.521 2.781 0 2.862 5.493 2.746 5.493 4.758 0 .695-.754 1.391-1.992 1.391-1.857 0-2.476-1.257-3.229-1.257-.368 0-.696.309-.696.775 0 .741 1.24 1.631 2.947 1.881l-.001.004v.934c0 .514.418.932.933.932.514-.001.931-.419.931-.932v-.934c0-.01-.005-.019-.006-.028 1.535-.287 2.816-1.286 2.816-3.075z"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/1f4c5.svg b/autogpt_platform/frontend/public/emoji/1f4c5.svgnew file mode 100644index 0000000000..476a9506cc--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/1f4c5.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#E0E7EC" d="M36 32c0 2.209-1.791 4-4 4H4c-2.209 0-4-1.791-4-4V9c0-2.209 1.791-4 4-4h28c2.209 0 4 1.791 4 4v23z"/><path d="M23.657 19.12H17.87c-1.22 0-1.673-.791-1.673-1.56 0-.791.429-1.56 1.673-1.56h8.184c1.154 0 1.628 1.04 1.628 1.628 0 .452-.249.927-.52 1.492l-5.607 11.395c-.633 1.266-.882 1.717-1.899 1.717-1.244 0-1.877-.949-1.877-1.605 0-.271.068-.474.226-.791l5.652-10.716zM10.889 19h-.5c-1.085 0-1.538-.731-1.538-1.5 0-.792.565-1.5 1.538-1.5h2.015c.972 0 1.515.701 1.515 1.605V30.47c0 1.13-.558 1.763-1.53 1.763s-1.5-.633-1.5-1.763V19z" fill="#66757F"/><path fill="#DD2F45" d="M34 0h-3.277c.172.295.277.634.277 1 0 1.104-.896 2-2 2s-2-.896-2-2c0-.366.105-.705.277-1H8.723C8.895.295 9 .634 9 1c0 1.104-.896 2-2 2s-2-.896-2-2c0-.366.105-.705.277-1H2C.896 0 0 .896 0 2v11h36V2c0-1.104-.896-2-2-2z"/><path d="M13.182 4.604c0-.5.32-.78.75-.78.429 0 .749.28.749.78v5.017h1.779c.51 0 .73.38.72.72-.02.33-.28.659-.72.659h-2.498c-.49 0-.78-.319-.78-.819V4.604zm-6.91 0c0-.5.32-.78.75-.78s.75.28.75.78v3.488c0 .92.589 1.649 1.539 1.649.909 0 1.529-.769 1.529-1.649V4.604c0-.5.319-.78.749-.78s.75.28.75.78v3.568c0 1.679-1.38 2.949-3.028 2.949-1.669 0-3.039-1.25-3.039-2.949V4.604zM5.49 9.001c0 1.679-1.069 2.119-1.979 2.119-.689 0-1.839-.27-1.839-1.14 0-.269.23-.609.56-.609.4 0 .75.37 1.199.37.56 0 .56-.52.56-.84V4.604c0-.5.32-.78.749-.78.431 0 .75.28.75.78v4.397z" fill="#F5F8FA"/><path d="M32 10c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m0-3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m-3 3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m0-3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m-3 3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m0-3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m-3 0c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1m0 3c0 .552.447 1 1 1s1-.448 1-1-.447-1-1-1-1 .448-1 1" fill="#F4ABBA"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/1f5c3.svg b/autogpt_platform/frontend/public/emoji/1f5c3.svgnew file mode 100644index 0000000000..48dd45b807--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/1f5c3.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#67757F" d="M35 20c0 2.209-1.791 2-4 2H5c-2.209 0-4 .209-4-2L3 8c.125-1.917 1.791-4 4-4h22c2.209 0 3.791 2.208 4 4l2 12z"/><path fill="#CCD6DD" d="M28 13c0 1.104-.896 2-2 2H10c-1.104 0-2-.896-2-2V5c0-1.105.896-2 2-2h16c1.104 0 2 .895 2 2v8z"/><path fill="#E1E8ED" d="M30 17c0 1.104-.896 2-2 2H8c-1.104 0-2-.896-2-2V9c0-1.104.896-2 2-2h20c1.104 0 2 .896 2 2v8z"/><path fill="#F5F8FA" d="M32 21c0 1.104-.896 2-2 2H6c-1.104 0-2-.896-2-2v-8c0-1.104.896-2 2-2h24c1.104 0 2 .896 2 2v8z"/><path fill="#9AAAB4" d="M35 31c0 2.209-1.791 4-4 4H5c-2.209 0-4-1.791-4-4V20c0-2.209 1.791-4 4-4h26c2.209 0 4 1.791 4 4v11z"/><path fill="#67757F" d="M14 12zm0 0z"/><path fill="#FCAB40" d="M22 1h-5c-1.104 0-2 .895-2 2v1h4c1.104 0 2 .896 2 2h1c1.104 0 2-.896 2-2V3c0-1.105-.896-2-2-2z"/><path fill="#5DADEC" d="M18 5h-5c-1.104 0-2 .896-2 2v1h4c1.104 0 2 .896 2 2h1c1.104 0 2-.896 2-2V7c0-1.104-.896-2-2-2z"/><path fill="#E75A70" d="M16 12c0 1.104-.896 2-2 2H9c-1.104 0-2-.896-2-2v-1c0-1.104.896-2 2-2h5c1.104 0 2 .896 2 2v1z"/><path fill="#67757F" d="M25 28c0 1.104-.896 2-2 2H13c-1.104 0-2-.896-2-2v-5c0-1.104.896-2 2-2h10c1.104 0 2 .896 2 2v5zm-11-4z"/><path fill="#E1E8ED" d="M23 27c0 .553-.447 1-1 1h-8c-.552 0-1-.447-1-1v-3c0-.553.448-1 1-1h8c.553 0 1 .447 1 1v3z"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/1f6a9.svg b/autogpt_platform/frontend/public/emoji/1f6a9.svgnew file mode 100644index 0000000000..a9338f1901--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/1f6a9.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#66757F" d="M13 34s0 2-2 2-2-2-2-2V2s0-2 2-2 2 2 2 2v32z"/><path fill="#DD2E44" d="M11 4c0-2.2 1.636-3.25 3.636-2.333l16.727 7.667c2 .917 2 2.417 0 3.333l-16.727 7.667C12.636 21.25 11 20.2 11 18V4z"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/26a0.svg b/autogpt_platform/frontend/public/emoji/26a0.svgnew file mode 100644index 0000000000..b9ee297352--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/26a0.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36"><path fill="#FFCC4D" d="M2.653 35C.811 35-.001 33.662.847 32.027L16.456 1.972c.849-1.635 2.238-1.635 3.087 0l15.609 30.056c.85 1.634.037 2.972-1.805 2.972H2.653z"/><path fill="#231F20" d="M15.583 28.953c0-1.333 1.085-2.418 2.419-2.418 1.333 0 2.418 1.085 2.418 2.418 0 1.334-1.086 2.419-2.418 2.419-1.334 0-2.419-1.085-2.419-2.419zm.186-18.293c0-1.302.961-2.108 2.232-2.108 1.241 0 2.233.837 2.233 2.108v11.938c0 1.271-.992 2.108-2.233 2.108-1.271 0-2.232-.807-2.232-2.108V10.66z"/></svg>\ No newline at end of filediff --git a/autogpt_platform/frontend/public/emoji/LICENSE.md b/autogpt_platform/frontend/public/emoji/LICENSE.mdnew file mode 100644index 0000000000..f9b7add267--- /dev/null+++ b/autogpt_platform/frontend/public/emoji/LICENSE.md@@ -0,0 +1,4 @@+These SVGs are [Twemoji](https://github.com/twitter/twemoji) 14.0.2 graphics,+Copyright 2020 Twitter, Inc and other contributors, licensed under+[CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). They are served+from the app itself so emoji work on offline and self-hosted installs.diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeCost.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeCost.tsxindex b1905c9730..339db98539 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeCost.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/NodeCost.tsx@@ -2,6 +2,7 @@ import { BlockCost } from "@/app/api/__generated__/models/blockCost";import { BlockCostType } from "@/app/api/__generated__/models/blockCostType";import { Text } from "@/components/atoms/Text/Text";import useCredits from "@/hooks/useCredits";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { isCostFilterMatch } from "../../../../helper";import { useNodeStore } from "@/app/(platform)/build/stores/nodeStore";import { useShallow } from "zustand/react/shallow";@@ -112,6 +113,7 @@ export const NodeCost = ({nodeId: string;}) => {const { formatCredits } = useCredits();+ const isBillingEnabled = useIsBillingEnabled();const hardcodedValues = useNodeStore(useShallow((state) => state.getHardCodedValues(nodeId)),);@@ -122,7 +124,7 @@ export const NodeCost = ({isCostFilterMatch(cost.cost_filter, hardcodedValues),);- if (!blockCost) return null;+ if (!isBillingEnabled || !blockCost) return null;const display = getDisplay(blockCost, formatCredits);diff --git a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/__tests__/NodeCost.test.tsx b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/__tests__/NodeCost.test.tsxindex d775c90235..accd613cc9 100644--- a/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/__tests__/NodeCost.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/build/components/FlowEditor/nodes/CustomNode/components/__tests__/NodeCost.test.tsx@@ -5,6 +5,12 @@ import { BlockCost } from "@/app/api/__generated__/models/blockCost";import { BlockCostType } from "@/app/api/__generated__/models/blockCostType";import { useNodeStore } from "@/app/(platform)/build/stores/nodeStore";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+vi.mock("@/hooks/useCredits", () => ({default: () => ({formatCredits: (credit: number | null) =>diff --git a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/navigation.tsx b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/navigation.tsxindex 54d2cef306..cc08fa8e78 100644--- a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/navigation.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/navigation.tsx@@ -127,6 +127,7 @@ function matchesQuery(target: NavTarget, query: string): boolean {export function buildNavigationBucket(query: string,currentPath: string | null,+ isBillingEnabled = true,): {bucket: SearchCommandBucket | null;isExactMatch: boolean;@@ -134,7 +135,9 @@ export function buildNavigationBucket(const normalized = query.trim().toLocaleLowerCase();const available = NAV_TARGETS.filter(- (target) => !isCurrentDestination(target, currentPath),+ (target) =>+ !isCurrentDestination(target, currentPath) &&+ (isBillingEnabled || target.id !== "nav:billing"),);const matches = normalized? available.filter((target) => matchesQuery(target, normalized))diff --git a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/useGlobalSearch.ts b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/useGlobalSearch.tsindex 54efe07f98..449af0ac8d 100644--- a/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/useGlobalSearch.ts+++ b/autogpt_platform/frontend/src/app/(platform)/components/GlobalSearchModal/useGlobalSearch.ts@@ -1,5 +1,6 @@import { usePathname } from "next/navigation";import { useEffect, useState } from "react";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { useGetSearchGlobalSearch } from "@/app/api/__generated__/endpoints/search/search";import type { GlobalSearchResponse } from "@/app/api/__generated__/models/globalSearchResponse";import { buildActionsBucket } from "./actions";@@ -11,6 +12,7 @@ const PER_TYPE_LIMIT = 4;export function useGlobalSearch(isOpen: boolean) {const pathname = usePathname();+ const isBillingEnabled = useIsBillingEnabled();const [query, setQuery] = useState("");const [debouncedQuery, setDebouncedQuery] = useState("");@@ -65,7 +67,7 @@ export function useGlobalSearch(isOpen: boolean) {// the search results; otherwise it trails them so search stays the// primary intent. Priority order on exact match: navigation, actions.const commandBuckets = [- buildNavigationBucket(query, pathname),+ buildNavigationBucket(query, pathname, isBillingEnabled),buildActionsBucket(query),];const topBuckets = commandBuckets.flatMap((entry) =>diff --git a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/RunDetailHeader/RunDetailHeader.tsx b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/RunDetailHeader/RunDetailHeader.tsxindex 0d7a298d8c..6345c4109d 100644--- a/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/RunDetailHeader/RunDetailHeader.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/library/agents/[id]/components/NewAgentLibraryView/components/selected-views/RunDetailHeader/RunDetailHeader.tsx@@ -6,6 +6,7 @@ import { AGENT_LIBRARY_SECTION_PADDING_X } from "../../../helpers";import { RunStatusBadge } from "../SelectedRunView/components/RunStatusBadge";import { FlaskConicalIcon, TimeScheduleIcon } from "@hugeicons/core-free-icons";import { Icon } from "@/components/atoms/Icon/Icon";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";type Props = {agent: LibraryAgent;@@ -16,6 +17,7 @@ type Props = {};export function RunDetailHeader({ agent, run, scheduleRecurrence }: Props) {+ const isBillingEnabled = useIsBillingEnabled();return (<div className={AGENT_LIBRARY_SECTION_PADDING_X}><div className="flex w-full items-center justify-between">@@ -84,7 +86,7 @@ export function RunDetailHeader({ agent, run, scheduleRecurrence }: Props) {</Text></>)}- {run.stats?.cost !== undefined && (+ {isBillingEnabled && run.stats?.cost !== undefined && (<><span className="mx-1 inline-block text-zinc-200">|</span><Text variant="small" className="text-zinc-500">diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsMobileNav.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsMobileNav.test.tsxindex a6efcdb1ac..4a980d3930 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsMobileNav.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsMobileNav.test.tsx@@ -7,6 +7,12 @@ import {} from "@/tests/integrations/test-utils";import { beforeEach, describe, expect, it, vi } from "vitest";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+type MockLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {children: ReactNode;href: string;diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsxindex 8c1419716c..ab2901c47c 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/SettingsSidebar.test.tsx@@ -2,6 +2,15 @@ import type { AnchorHTMLAttributes, ReactNode } from "react";import { render, screen } from "@/tests/integrations/test-utils";import { beforeEach, describe, expect, it, vi } from "vitest";+let mockIsBillingEnabled = true;+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => mockIsBillingEnabled,+ useBillingStatus: () => ({+ isBillingEnabled: mockIsBillingEnabled,+ isResolved: true,+ }),+}));+type MockLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {children: ReactNode;href: string;@@ -51,6 +60,15 @@ const expectedItems = [describe("SettingsSidebar", () => {beforeEach(() => {usePathnameMock.mockReturnValue("/settings/profile");+ mockIsBillingEnabled = true;+ });++ it("leaves Billing out on a self-hosted install without payments", () => {+ mockIsBillingEnabled = false;+ render(<SettingsSidebar />);++ expect(screen.queryByRole("link", { name: /billing/i })).toBeNull();+ expect(screen.getByRole("link", { name: /integrations/i })).toBeDefined();});it("renders a Back link to /copilot and all 6 nav items with correct hrefs", () => {diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/placeholder-pages.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/placeholder-pages.test.tsxindex 48bc154998..1662586cc0 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/placeholder-pages.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/__tests__/placeholder-pages.test.tsx@@ -1,9 +1,31 @@import { render, screen } from "@/tests/integrations/test-utils";-import { describe, expect, it } from "vitest";+import { afterEach, describe, expect, it, vi } from "vitest";import SettingsBillingPage from "../billing/page";import SettingsOAuthAppsPage from "../oauth-apps/page";+let mockIsBillingEnabled = true;+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => mockIsBillingEnabled,+ useBillingStatus: () => ({+ isBillingEnabled: mockIsBillingEnabled,+ isResolved: true,+ }),+}));+describe("Settings billing page", () => {+ afterEach(() => {+ mockIsBillingEnabled = true;+ });++ it("is not found on a self-hosted install without payments", () => {+ mockIsBillingEnabled = false;++ vi.spyOn(console, "error").mockImplementation(() => {});+ expect(() => render(<SettingsBillingPage />)).toThrow(+ "NEXT_HTTP_ERROR_FALLBACK;404",+ );+ });+it("renders title and billing tabs", () => {render(<SettingsBillingPage />);diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-page.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-page.test.tsxindex c3ea71cbee..33589777b2 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-page.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-page.test.tsx@@ -7,6 +7,12 @@ import { render, screen, waitFor } from "@/tests/integrations/test-utils";import { AutomationCreditsTab } from "../components/AutomationCreditsTab/AutomationCreditsTab";import SettingsBillingPage from "../page";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+// Allow per-test override of the search params Next.js exposes to the page.const mockSearchParams = { current: new URLSearchParams() };const mockRouterReplace = vi.fn();diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-posthog.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-posthog.test.tsxindex 951f1d0bde..0ecfd942b2 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-posthog.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/billing-posthog.test.tsx@@ -11,6 +11,12 @@ import { usePaymentMethodCard } from "../components/SubscriptionTab/PaymentMethoimport { useYourPlanCard } from "../components/SubscriptionTab/YourPlanCard/useYourPlanCard";import SettingsBillingPage from "../page";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+const posthog = vi.hoisted(() => ({__loaded: true,is_capturing: () => true,diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-checkout-return.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-checkout-return.test.tsxindex 5cad2e449b..b66353836a 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-checkout-return.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-checkout-return.test.tsx@@ -11,6 +11,12 @@ import {trialSubscription,} from "./trial-plan-fixtures";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+const mockSearchParams = vi.hoisted(() => ({current: new URLSearchParams(),}));diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-choices.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-choices.test.tsxindex 1332b9f9c1..bfdf2f6848 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-choices.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-choices.test.tsx@@ -20,6 +20,12 @@ import {yearlyOffer,} from "./trial-plan-fixtures";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+const analytics = vi.hoisted(() => ({trackPaywallViewed: vi.fn(),}));diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-subscribe.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-subscribe.test.tsxindex c088c82909..e0ebd58515 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-subscribe.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-subscribe.test.tsx@@ -24,6 +24,12 @@ import {yearlyOffer,} from "./trial-plan-fixtures";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+const toast = vi.hoisted(() => vi.fn());vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => ({...(await importOriginal<diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-upgrade.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-upgrade.test.tsxindex 50218a7e86..c556c242a3 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-upgrade.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-upgrade.test.tsx@@ -26,6 +26,12 @@ import {yearlyOffer,} from "./trial-plan-fixtures";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+const toast = vi.hoisted(() => vi.fn());vi.mock("@/components/molecules/Toast/use-toast", async (importOriginal) => ({...(await importOriginal<diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-visibility.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-visibility.test.tsxindex 1f9c43c7d8..82be62ae19 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-visibility.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-plan-visibility.test.tsx@@ -1,5 +1,5 @@import { http, HttpResponse } from "msw";-import { afterEach, beforeEach, expect, it } from "vitest";+import { afterEach, beforeEach, expect, it, vi } from "vitest";import { getGetTrialsGetTrialStatusMockHandler200 } from "@/app/api/__generated__/endpoints/trials/trials.msw";import { server } from "@/mocks/mock-server";import { render, screen } from "@/tests/integrations/test-utils";@@ -9,6 +9,12 @@ import {} from "@/tests/integrations/trial-fixtures";import SettingsBillingPage from "../page";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+beforeEach(() => setTrialUser());afterEach(() => setTrialUser(null));diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-rejection.test.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-rejection.test.tsxindex 14aeced7d9..832bf28b7a 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-rejection.test.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/__tests__/trial-rejection.test.tsx@@ -10,6 +10,12 @@ import {trialResponse,} from "@/tests/integrations/trial-fixtures";+// These cover the hosted billing UI, which self-hosted builds hide.+vi.mock("@/hooks/useIsBillingEnabled", () => ({+ useIsBillingEnabled: () => true,+ useBillingStatus: () => ({ isBillingEnabled: true, isResolved: true }),+}));+let searchParams = new URLSearchParams();vi.mock("next/navigation", () => ({useSearchParams: () => searchParams,diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/billing/page.tsx b/autogpt_platform/frontend/src/app/(platform)/settings/billing/page.tsxindex 0ef58f229c..ae8275d50d 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/billing/page.tsx+++ b/autogpt_platform/frontend/src/app/(platform)/settings/billing/page.tsx@@ -1,10 +1,11 @@"use client";import { useEffect, useRef, useState } from "react";-import { useRouter, useSearchParams } from "next/navigation";+import { notFound, useRouter, useSearchParams } from "next/navigation";import { useQueryClient } from "@tanstack/react-query";import { Text } from "@/components/atoms/Text/Text";+import { useBillingStatus } from "@/hooks/useIsBillingEnabled";import {TabsLine,TabsLineContent,@@ -42,7 +43,14 @@ function resolveInitialTab(searchParams: URLSearchParams): BillingTab {return "subscription";}-export default function SettingsBillingPage() {+export default function SettingsBillingRoute() {+ const { isBillingEnabled, isResolved } = useBillingStatus();+ if (!isResolved) return null;+ if (!isBillingEnabled) notFound();+ return <SettingsBillingPage />;+}++function SettingsBillingPage() {const router = useRouter();const searchParams = useSearchParams();const queryClient = useQueryClient();diff --git a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.tsindex 871c239116..6ba0fc610f 100644--- a/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts+++ b/autogpt_platform/frontend/src/app/(platform)/settings/components/SettingsSidebar/useSettingsSidebar.ts@@ -1,13 +1,16 @@import { usePathname } from "next/navigation";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { Flag, useGetFlag } from "@/services/feature-flags/use-get-flag";import { settingsNavItems } from "./helpers";export function useSettingsSidebar() {const pathname = usePathname();const isMemoryEnabled = useGetFlag(Flag.GRAPHITI_MEMORY);+ const isBillingEnabled = useIsBillingEnabled();const items = settingsNavItems.filter((item) => item.flag !== Flag.GRAPHITI_MEMORY || isMemoryEnabled)+ .filter((item) => item.href !== "/settings/billing" || isBillingEnabled).map((item) => ({...item,isActive:diff --git a/autogpt_platform/frontend/src/app/layout.tsx b/autogpt_platform/frontend/src/app/layout.tsxindex 4e6cc74c37..4319b5da90 100644--- a/autogpt_platform/frontend/src/app/layout.tsx+++ b/autogpt_platform/frontend/src/app/layout.tsx@@ -25,6 +25,10 @@ import { getSiteUrl } from "@/lib/metadata";const isDev = environment.isDev();const isLocal = environment.isLocal();+const isCloud = environment.isCloud();+// Agentation annotates the UI for whoever is building AutoGPT itself, so it+// stays out of production builds; self-hosted installs are production builds.+const showAgentation = environment.isDevelopmentBuild() || isDev;const faviconPath = isDev? "/favicon-dev.ico"@@ -117,7 +121,7 @@ export default async function RootLayout({/><div className="flex min-h-screen flex-col items-stretch justify-items-stretch">{children}- <TallyPopupSimple />+ {isCloud && <TallyPopupSimple />}<VercelAnalyticsWrapper />{/* React Query DevTools is only available in development */}@@ -130,7 +134,7 @@ export default async function RootLayout({</div><Toaster /><ConsentWithdrawalReload />- {(isLocal || isDev) && <AgentationDevtool />}+ {showAgentation && <AgentationDevtool />}</Providers></ErrorBoundary></body>diff --git a/autogpt_platform/frontend/src/components/atoms/Emoji/Emoji.tsx b/autogpt_platform/frontend/src/components/atoms/Emoji/Emoji.tsxindex 0ea5bf32b9..34dde040b7 100644--- a/autogpt_platform/frontend/src/components/atoms/Emoji/Emoji.tsx+++ b/autogpt_platform/frontend/src/components/atoms/Emoji/Emoji.tsx@@ -1,5 +1,22 @@import twemoji from "twemoji";+// Served from public/emoji so the browser never fetches a third-party CDN,+// which an offline or self-hosted install may not reach. Add an emoji's SVG+// there (Twemoji 14.0.2, named by codepoint) before using it; any other emoji+// renders as the system glyph.+const BUNDLED_EMOJI = new Set([+ "1f4a4",+ "1f4b5",+ "1f4c5",+ "1f5c3",+ "1f6a9",+ "26a0",+]);++function bundledEmojiURL(icon: string) {+ return BUNDLED_EMOJI.has(icon) ? `/emoji/${icon}.svg` : false;+}+interface Props {text: string;size?: number;@@ -22,12 +39,11 @@ function escapeHtml(input: string) {export function Emoji({ text, size = 24 }: Props) {// Strip the default alt (the emoji codepoint) so the browser doesn't flash- // the small system-rendered emoji while the SVG loads from the CDN. The+ // the small system-rendered emoji while the SVG loads. The// twemoji API doesn't expose an alt override, hence the regex.const html = twemoji.parse(escapeHtml(text), {- folder: "svg",- ext: ".svg",+ callback: bundledEmojiURL,attributes: () => ({width: String(size),height: String(size),diff --git a/autogpt_platform/frontend/src/components/auth/WaitlistErrorContent.tsx b/autogpt_platform/frontend/src/components/auth/WaitlistErrorContent.tsxindex 9d64738813..df66bc67cb 100644--- a/autogpt_platform/frontend/src/components/auth/WaitlistErrorContent.tsx+++ b/autogpt_platform/frontend/src/components/auth/WaitlistErrorContent.tsx@@ -1,3 +1,4 @@+import { environment } from "@/services/environment";import { Button } from "../atoms/Button/Button";import { Text } from "../atoms/Text/Text";@@ -6,6 +7,7 @@ interface Props {}export function WaitlistErrorContent(props: Props) {+ if (!environment.isCloud()) return <SelfHostedNotAllowed {...props} />;return (<div className="flex flex-col items-center gap-6"><Text variant="h3">We're in closed beta</Text>@@ -54,3 +56,22 @@ export function WaitlistErrorContent(props: Props) {</div>);}++// A self-hosted instance's allowlist belongs to its operator, not to AutoGPT's+// waitlist, so point the user at whoever runs it.+function SelfHostedNotAllowed(props: Props) {+ return (+ <div className="flex flex-col items-center gap-6">+ <Text variant="h3">This email can't sign up here</Text>+ <Text variant="large" className="text-center">+ This instance only allows approved emails. Ask your administrator to add+ yours, or sign up with an email they have already approved.+ </Text>+ {props.onBackToLogin ? (+ <Button variant="secondary" onClick={props.onBackToLogin}>+ Back to Login+ </Button>+ ) : null}+ </div>+ );+}diff --git a/autogpt_platform/frontend/src/components/auth/__tests__/EmailNotAllowedModal.test.tsx b/autogpt_platform/frontend/src/components/auth/__tests__/EmailNotAllowedModal.test.tsxindex 6a7d8ab3a8..2f49695456 100644--- a/autogpt_platform/frontend/src/components/auth/__tests__/EmailNotAllowedModal.test.tsx+++ b/autogpt_platform/frontend/src/components/auth/__tests__/EmailNotAllowedModal.test.tsx@@ -2,6 +2,16 @@ import { describe, expect, test, vi } from "vitest";import { render, screen, within } from "@/tests/integrations/test-utils";import { EmailNotAllowedModal } from "../EmailNotAllowedModal";+let mockIsCloud = true;+vi.mock("@/services/environment", async (importOriginal) => {+ const actual =+ await importOriginal<typeof import("@/services/environment")>();+ return {+ ...actual,+ environment: { ...actual.environment, isCloud: () => mockIsCloud },+ };+});+vi.mock("@/lib/hooks/useBreakpoint", () => ({useBreakpoint: () => "lg",isLargeScreen: () => true,@@ -23,6 +33,19 @@ describe("EmailNotAllowedModal", () => {expect(within(dialog).getByText(/join waitlist/i)).toBeDefined();});+ test("points a self-hoster at their administrator, not the hosted waitlist", () => {+ mockIsCloud = false;+ render(<EmailNotAllowedModal isOpen={true} onClose={vi.fn()} />);+ mockIsCloud = true;++ const dialog = screen.getByRole("dialog");+ expect(+ within(dialog).getByText(/only allows approved emails/i),+ ).toBeDefined();+ expect(within(dialog).queryByText(/closed beta/i)).toBeNull();+ expect(within(dialog).queryByText(/join waitlist/i)).toBeNull();+ });+test("does not render dialog when closed", () => {render(<EmailNotAllowedModal isOpen={false} onClose={vi.fn()} />);diff --git a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsxindex 74f8538543..a486b4d2c7 100644--- a/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx+++ b/autogpt_platform/frontend/src/components/layout/AppSidebar/components/SidebarUserActions/SidebarUserActions.tsx@@ -1,5 +1,6 @@"use client";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { useGetV2GetUserProfile } from "@/app/api/__generated__/endpoints/store/store";import { okData } from "@/app/api/helpers";import { AccountMenu } from "@/components/layout/Navbar/components/AccountMenu/AccountMenu";@@ -19,7 +20,12 @@ export function SidebarUserActions() {const { state } = useSidebar();const isCollapsed = state === "collapsed";const logoutInProgress = isLogoutInProgress();- const dynamicMenuItems = getAccountMenuItems(user?.role, true);+ const isBillingEnabled = useIsBillingEnabled();+ const dynamicMenuItems = getAccountMenuItems(+ user?.role,+ true,+ isBillingEnabled,+ );const { data: profile, isLoading: isProfileLoading } = useGetV2GetUserProfile({diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsxindex 7dc583a707..9009a419e4 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/Navbar.tsx@@ -1,5 +1,6 @@"use client";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { useGetV2GetUserProfile } from "@/app/api/__generated__/endpoints/store/store";import { okData } from "@/app/api/helpers";import { IconType } from "@/components/__legacy__/ui/icons";@@ -37,7 +38,12 @@ export function Navbar() {const { user, isLoggedIn, isUserLoading } = useAuth();const breakpoint = useBreakpoint();const isSmallScreen = breakpoint === "sm" || breakpoint === "base";- const dynamicMenuItems = getAccountMenuItems(user?.role);+ const isBillingEnabled = useIsBillingEnabled();+ const dynamicMenuItems = getAccountMenuItems(+ user?.role,+ false,+ isBillingEnabled,+ );const previewBranchName = environment.getPreviewStealingDev();const logoutInProgress = isLogoutInProgress();@@ -114,7 +120,7 @@ export function Navbar() {<div className="flex flex-1 items-center justify-end gap-4"><div className="flex items-center gap-4"><OrgTeamSwitcher />- <FeedbackButton />+ {environment.isCloud() && <FeedbackButton />}<AgentActivityDropdown />{profile && <Wallet key={profile.username} />}<AccountMenudiff --git a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/Wallet.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/Wallet.tsxindex 0f9b83be0e..00930d93be 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/Wallet.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/components/Wallet/Wallet.tsx@@ -5,6 +5,7 @@ import {PopoverContent,} from "@/components/molecules/Popover/Popover";import { TopUpDialog } from "@/components/layout/TopUpPrompt/TopUpDialog/TopUpDialog";+import { useIsBillingEnabled } from "@/hooks/useIsBillingEnabled";import { cn } from "@/lib/utils";import { WalletCompactPanel } from "./components/WalletCompactPanel";import { WalletFullPanel } from "./components/WalletFullPanel";@@ -16,6 +17,7 @@ interface Props {}export function Wallet({ compact = false }: Props) {+ const isBillingEnabled = useIsBillingEnabled();const {state,groups,@@ -34,7 +36,7 @@ export function Wallet({ compact = false }: Props) {} = useWallet();// Do not render until we have both credits and onboarding data- if (credits === null || !state) return null;+ if (!isBillingEnabled || credits === null || !state) return null;return (<>diff --git a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsxindex 123659db80..b86830a2e2 100644--- a/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx+++ b/autogpt_platform/frontend/src/components/layout/Navbar/helpers.tsx@@ -98,10 +98,16 @@ export const accountMenuItems: MenuItemGroup[] = [export function getAccountMenuItems(userRole?: string,newLayout = false,+ isBillingEnabled = true,): MenuItemGroup[] {- return newLayout+ const groups = newLayout? getNewLayoutAccountMenuItems(userRole): getClassicAccountMenuItems(userRole);+ if (isBillingEnabled) return groups;+ return groups.map((group) => ({+ ...group,+ items: group.items.filter((item) => item.href !== "/settings/billing"),+ }));}// New sidebar layout grouping — gated behind the AUTOGPT_NEW_LAYOUT flag.diff --git a/autogpt_platform/frontend/src/hooks/useIsBillingEnabled.ts b/autogpt_platform/frontend/src/hooks/useIsBillingEnabled.tsnew file mode 100644index 0000000000..2d796c9161--- /dev/null+++ b/autogpt_platform/frontend/src/hooks/useIsBillingEnabled.ts@@ -0,0 +1,26 @@+import { environment } from "@/services/environment";+import {+ Flag,+ useFlagStatus,+ useGetFlag,+} from "@/services/feature-flags/use-get-flag";++// Billing, credits and paywall UI. The hosted platform (a cloud build) always+// shows it. A self-hosted install has no Stripe and no credit ledger by+// default, so it shows it only once its operator turns payments on with+// NEXT_PUBLIC_FORCE_FLAG_ENABLE_PLATFORM_PAYMENT.+export function useIsBillingEnabled() {+ const isPaymentEnabled = useGetFlag(Flag.ENABLE_PLATFORM_PAYMENT);+ return environment.isCloud() || isPaymentEnabled === true;+}++// For gating a whole route: ``isResolved`` stays false until the flag vendor+// has answered or timed out, so a self-hosted install that turns payments on+// through a vendor is not sent to a 404 before the answer arrives, and one+// whose vendor never answers still gets a page.+export function useBillingStatus() {+ const { enabled, ready } = useFlagStatus(Flag.ENABLE_PLATFORM_PAYMENT);+ if (environment.isCloud())+ return { isBillingEnabled: true, isResolved: true };+ return { isBillingEnabled: enabled === true, isResolved: ready };+}diff --git a/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx b/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsxindex e5e16dfc1d..fb24a97323 100644--- a/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx+++ b/autogpt_platform/frontend/src/tests/integrations/setup-nextjs-mocks.tsx@@ -50,6 +50,9 @@ export const mockNextjsModules = () => {usePathname: () => "/marketplace",useSearchParams: () => new URLSearchParams(),useParams: () => ({}),+ notFound: () => {+ throw new Error("NEXT_HTTP_ERROR_FALLBACK;404");+ },}));vi.mock("next/link", () => ({