Skip to content

Commit dbe81dc

Browse files
fix(cursor): retry a timed-out catalog read before reporting an error
One slow api.cursor.com response made checkCursorProviderStatus report Cursor as an error. The catalog read now gets a second attempt with a fresh deadline before a timeout is reported. Fixes #34539 AI-assisted; verified with the tests and tools listed above.
1 parent 38ffc1c commit dbe81dc

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/provider-cursor/src/server/status.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,14 @@ export const checkCursorProviderStatus = Effect.fn("checkCursorProviderStatus")(
286286
}
287287

288288
const sdkCatalog = yield* CursorSdkCatalog.CursorSdkCatalog;
289-
const catalogResult = yield* sdkCatalog
290-
.read(sdkApiKey)
291-
.pipe(Effect.timeoutOption(CURSOR_SDK_CATALOG_TIMEOUT_MS), Effect.result);
289+
const readCatalog = Effect.suspend(() => sdkCatalog.read(sdkApiKey)).pipe(
290+
Effect.timeoutOption(CURSOR_SDK_CATALOG_TIMEOUT_MS),
291+
);
292+
// api.cursor.com latency is intermittent; one slow read should not flip the provider to error.
293+
const catalogResult = yield* readCatalog.pipe(
294+
Effect.filterOrElse(Option.isSome, () => readCatalog),
295+
Effect.result,
296+
);
292297

293298
if (Result.isFailure(catalogResult)) {
294299
yield* Effect.logWarning("Cursor SDK catalog probe failed", {

0 commit comments

Comments
 (0)