Skip to content

Commit a0156fb

Browse files
committed
chore(webapp): disconnect the message quota from billing — the cap stays built but dormant
Plan detection moves to the billing service (plan-defined limit, billing-period window, separate ticket). The counter, upgrade block and submit guard remain wired; with no plan answer the quota resolves to unlimited.
1 parent 19d6625 commit a0156fb

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

apps/webapp/app/components/dashboard-agent/useAgentMessageQuota.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import type { UIMessage } from "@ai-sdk/react";
22
import { useEffect, useState } from "react";
3-
import { useCurrentPlan } from "~/routes/_app.orgs.$organizationSlug/route";
43
import { countUserMessages, resolveMessageQuota, type MessageQuota } from "./message-quota";
54

65
/**
7-
* Whether this org is on the Free plan.
6+
* Whether the message cap applies to this org.
87
*
9-
* Undefined — not false — when we can't tell: self-hosted with no billing
10-
* service, a billing call that failed, or the org route data not loaded yet. The
11-
* quota treats undefined as "no cap" (see `resolveMessageQuota`), so an unknown
12-
* plan can never lock someone out.
8+
* Always undefined for now: plan detection belongs to the billing service and
9+
* will be wired up there (plan-defined limit, billing-period window). Undefined
10+
* means "no cap" (see `resolveMessageQuota`), so the whole quota surface —
11+
* counter, upgrade block, submit guard — stays built and tested but dormant
12+
* until billing supplies the answer.
1313
*/
1414
function useIsFreePlan(): boolean | undefined {
15-
const isPaying = useCurrentPlan()?.v3Subscription?.isPaying;
16-
return typeof isPaying === "boolean" ? !isPaying : undefined;
15+
return undefined;
1716
}
1817

1918
/**

0 commit comments

Comments
 (0)