Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/provider-cursor/src/server/textGeneration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ describe("CursorTextGeneration", () => {
id: "run-cursor-partial-title-test",
status,
result: '{"title":"Partial title from a failed run."}',
...(status === "error" ? { error: { message: "Usage limit reached." } } : {}),
} satisfies RunResult;
cursorSdkMock.prompt.mockResolvedValueOnce(promptResult);
const generation = yield* makeCursorTextGeneration(cursorSettings, {
Expand All @@ -222,7 +223,7 @@ describe("CursorTextGeneration", () => {
expect(failure.detail).toBe(
status === "cancelled"
? "Cursor SDK request was cancelled."
: "Cursor SDK request finished with an error.",
: "Cursor SDK request finished with an error: Usage limit reached.",
);
expect(cursorSdkMock.close).toHaveBeenCalledOnce();
}).pipe(Effect.provide(layerTest)),
Expand Down
8 changes: 6 additions & 2 deletions packages/provider-cursor/src/server/textGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ function cursorSdkResultDetail(result: RunResult): string {
switch (result.status) {
case "cancelled":
return "Cursor SDK request was cancelled.";
case "error":
return "Cursor SDK request finished with an error.";
case "error": {
const message = result.error?.message.trim();
Comment thread
saphid marked this conversation as resolved.
Resolved
return message
? `Cursor SDK request finished with an error: ${message}`
: "Cursor SDK request finished with an error.";
}
case "finished":
return "Cursor SDK returned empty output.";
}
Expand Down
Loading