@@ -182,9 +182,8 @@ describe("CursorTextGeneration", () => {
182182 { name : "invalid JSON" , result : "Add a generated commit message" } ,
183183 {
184184 name : "a body with the wrong type" ,
185- result : '{"subject":"Add generated commit message","body":[],"branch":"generated-message" }' ,
185+ result : '{"subject":"Add generated commit message","body":[]}' ,
186186 } ,
187- { name : "a missing branch" , result : '{"subject":"Add generated commit message","body":""}' } ,
188187 ] ) ( "retries $name with a fresh agent before returning a commit message" , ( { result } ) =>
189188 Effect . gen ( function * ( ) {
190189 cursorSdkMock . prompt
@@ -194,8 +193,7 @@ describe("CursorTextGeneration", () => {
194193 return {
195194 id : "valid-output" ,
196195 status : "finished" ,
197- result :
198- '{"subject":"Add generated commit message","body":"","branch":"generated-message"}' ,
196+ result : '{"subject":"Add generated commit message","body":""}' ,
199197 } ;
200198 } ) ;
201199 const generation = yield * makeCursorTextGeneration ( cursorSettings , {
@@ -206,19 +204,15 @@ describe("CursorTextGeneration", () => {
206204 branch : "feature/cursor" ,
207205 stagedSummary : "M file.ts" ,
208206 stagedPatch : "diff" ,
209- includeBranch : true ,
210207 modelSelection : createModelSelection ( ProviderInstanceId . make ( "cursor" ) , "auto" ) ,
211208 } ) ;
212209
213210 expect ( generated ) . toEqual ( {
214211 subject : "Add generated commit message" ,
215212 body : "" ,
216- branch : "feature/generated-message" ,
217213 } ) ;
218214 expect ( cursorSdkMock . create ) . toHaveBeenCalledTimes ( 2 ) ;
219- expect ( cursorSdkMock . send . mock . calls [ 1 ] ) . toEqual ( cursorSdkMock . send . mock . calls [ 0 ] ) ;
220215 expect ( cursorSdkMock . close ) . toHaveBeenCalledTimes ( 2 ) ;
221- expect ( cursorSdkMock . cancel ) . not . toHaveBeenCalled ( ) ;
222216 expect ( cursorSdkMock . storeDispose ) . toHaveBeenCalledOnce ( ) ;
223217 } ) . pipe ( Effect . provide ( layerTest ) ) ,
224218 ) ;
@@ -247,8 +241,6 @@ describe("CursorTextGeneration", () => {
247241 expect ( failure . detail ) . toBe ( "Cursor SDK returned invalid structured output." ) ;
248242 expect ( Schema . isSchemaError ( failure . cause ) ) . toBe ( true ) ;
249243 expect ( cursorSdkMock . prompt ) . toHaveBeenCalledTimes ( 2 ) ;
250- expect ( cursorSdkMock . close ) . toHaveBeenCalledTimes ( 2 ) ;
251- expect ( cursorSdkMock . storeDispose ) . toHaveBeenCalledOnce ( ) ;
252244 } ) . pipe ( Effect . provide ( layerTest ) ) ,
253245 ) ;
254246
@@ -315,50 +307,6 @@ describe("CursorTextGeneration", () => {
315307 } ) . pipe ( Effect . provide ( layerTest ) ) ,
316308 ) ;
317309
318- it . effect . each ( [ undefined , "" , " " ] ) ( "does not retry empty output (%s)" , ( result ) =>
319- Effect . gen ( function * ( ) {
320- cursorSdkMock . prompt . mockResolvedValueOnce ( {
321- id : "empty-output" ,
322- status : "finished" ,
323- ...( result === undefined ? { } : { result } ) ,
324- } ) ;
325- const generation = yield * makeCursorTextGeneration ( cursorSettings , {
326- CURSOR_API_KEY : "test-cursor-key" ,
327- } ) ;
328- const failure = yield * Effect . flip (
329- generation . generateThreadTitle ( {
330- cwd : process . cwd ( ) ,
331- message : "Fix reconnect" ,
332- modelSelection : createModelSelection ( ProviderInstanceId . make ( "cursor" ) , "auto" ) ,
333- } ) ,
334- ) ;
335-
336- expect ( failure . detail ) . toBe ( "Cursor SDK returned empty output." ) ;
337- expect ( cursorSdkMock . prompt ) . toHaveBeenCalledOnce ( ) ;
338- } ) . pipe ( Effect . provide ( layerTest ) ) ,
339- ) ;
340-
341- it . effect ( "does not retry an SDK request rejection" , ( ) =>
342- Effect . gen ( function * ( ) {
343- cursorSdkMock . prompt . mockRejectedValueOnce ( new Error ( "SDK request failed" ) ) ;
344- const generation = yield * makeCursorTextGeneration ( cursorSettings , {
345- CURSOR_API_KEY : "test-cursor-key" ,
346- } ) ;
347- const failure = yield * Effect . flip (
348- generation . generateThreadTitle ( {
349- cwd : process . cwd ( ) ,
350- message : "Fix reconnect" ,
351- modelSelection : createModelSelection ( ProviderInstanceId . make ( "cursor" ) , "auto" ) ,
352- } ) ,
353- ) ;
354-
355- expect ( failure . detail ) . toBe ( "Cursor SDK text generation failed." ) ;
356- expect ( cursorSdkMock . prompt ) . toHaveBeenCalledOnce ( ) ;
357- expect ( cursorSdkMock . close ) . toHaveBeenCalledOnce ( ) ;
358- expect ( cursorSdkMock . storeDispose ) . toHaveBeenCalledOnce ( ) ;
359- } ) . pipe ( Effect . provide ( layerTest ) ) ,
360- ) ;
361-
362310 it . effect . each ( [ "error" , "cancelled" ] as const ) (
363311 "rejects a %s Cursor SDK run that includes valid title JSON" ,
364312 ( status ) =>
0 commit comments