Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Cursor status says when the account's plan is rejected #15569

Closedpedrozimmermannsoares(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/15569/headopened View on GitHub

Showing 2 changed files with 35 additions and 1 deletion.

x
0 of 2 viewed, 2 left
29 additions and 0 deletionsapps/server/src/provider/Layers/CursorProvider.test.tsModified
View file
@@ -13,6 +13,7 @@
buildInitialCursorProviderSnapshot,
checkCursorProviderStatus,
} from "./CursorProvider.ts";
+import { CursorSdkError } from "../cursorSdk.ts";
import * as CursorSdkCatalog from "./CursorSdkCatalog.ts";
​
const decodeCursorSettings = Schema.decodeSync(CursorSettingsSchema);
@@ -231,6 +232,34 @@
}),
​
+ it.effect("says when Cursor rejects the account's plan", () =>
+ Effect.gen(function* () {
+ const provider = yield* checkCursorProviderStatus(baseCursorSettings, {
+ CURSOR_API_KEY: "free-plan-test-key",
+ }).pipe(
+ Effect.provide(
+ CursorSdkCatalog.makeCursorSdkCatalogTestLayer(() =>
+ Effect.fail(
+ new CursorSdkCatalog.CursorSdkCatalogError({
+ authenticationFailure: false,
+ cause: new CursorSdkError(
+ "[plan_required] Cloud Agent is not available for free users. Please upgrade to Pro.",
+ { code: "plan_required", status: 403, isRetryable: false },
+ ),
+ }),
+ ),
+ ),