Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): retry Cursor text generation without sandboxing #13863

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 1 commit intot3code/codex-turn-mapping fromfix-cursor-text-generation-sandboxmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 99 additions and 5 deletions.

x
0 of 2 viewed, 2 left
60 additions and 0 deletionsapps/server/src/textGeneration/CursorTextGeneration.test.tsModified
View file
@@ -141,6 +141,66 @@
}).pipe(Effect.provide(fsLayer)),
​
+ it.effect("continues in the temp directory when the SDK cannot sandbox", () =>
+ Effect.gen(function* () {
+ cursorSdkMock.create.mockImplementationOnce(async () => {
+ throw new Error(
+ "Local SDK sandboxing was requested, but sandboxing is not supported in this environment. Disable local.sandboxOptions.enabled or remove ~/.cursor/sandbox.json to run without sandboxing.",
+ );
+ });
+ const textGeneration = yield* makeCursorTextGeneration(cursorSettings, {
+ CURSOR_API_KEY: "test-cursor-key",
+ });
+​
+ const generated = yield* textGeneration.generateCommitMessage({
+ cwd: process.cwd(),
+ branch: "feature/cursor-text-generation",
+ stagedSummary: "M apps/server/src/textGeneration/CursorTextGeneration.ts",
+ stagedPatch: "diff --git a/apps/server/src/textGeneration/CursorTextGeneration.ts",
+ modelSelection: createModelSelection(ProviderInstanceId.make("cursor"), "composer-2"),
+ });
+​
+ expect(generated.subject).toBe("Add generated commit message");
+ expect(cursorSdkMock.create).toHaveBeenCalledTimes(2);
+ expect(cursorSdkMock.create.mock.calls[0]?.[0]).toMatchObject({
+ local: { sandboxOptions: { enabled: true } },
+ });
+ expect(cursorSdkMock.create.mock.calls[1]?.[0]).toMatchObject({
+ local: {