@@ -441,9 +441,9 @@ describe("CoderAgentChatAction", () => {
441441 expect ( out . baseBranch ) . toBe ( "main" ) ;
442442 } ) ;
443443
444- test ( "converts null pull_request_title to undefined " , ( ) => {
445- // pull_request_title is .nullable().optional(); explicit null
446- // from the API maps to undefined so the output is unset .
444+ test ( "converts empty pull_request_title to empty string " , ( ) => {
445+ // pull_request_title is always a string from the API;
446+ // an empty string passes through as-is .
447447 const inputs = createMockInputs ( ) ;
448448 const action = new CoderAgentChatAction (
449449 coderClient ,
@@ -454,18 +454,18 @@ describe("CoderAgentChatAction", () => {
454454 if ( ! diff ) {
455455 throw new Error ( "mockChatWithDiff must have diff_status set" ) ;
456456 }
457- const chatWithNullTitle : typeof mockChatWithDiff = {
457+ const chatWithEmptyTitle : typeof mockChatWithDiff = {
458458 ...mockChatWithDiff ,
459- diff_status : { ...diff , pull_request_title : null } ,
459+ diff_status : { ...diff , pull_request_title : "" } ,
460460 } ;
461461
462462 const out = action . buildOutputs (
463463 mockUser . username ,
464- chatWithNullTitle ,
464+ chatWithEmptyTitle ,
465465 false ,
466466 ) ;
467467
468- expect ( out . pullRequestTitle ) . toBeUndefined ( ) ;
468+ expect ( out . pullRequestTitle ) . toBe ( "" ) ;
469469 } ) ;
470470
471471 test ( "emits zero numerics when a PR exists" , ( ) => {
@@ -570,7 +570,7 @@ describe("CoderAgentChatAction", () => {
570570 const chatWithError : typeof mockChat = {
571571 ...mockChat ,
572572 status : "error" ,
573- last_error : "spend cap reached" ,
573+ last_error : { message : "spend cap reached" , retryable : false } ,
574574 } ;
575575
576576 const out = action . buildOutputs ( mockUser . username , chatWithError , true ) ;
@@ -919,7 +919,7 @@ describe("CoderAgentChatAction", () => {
919919 . mockResolvedValueOnce ( {
920920 ...mockChat ,
921921 status : "error" ,
922- last_error : "Anthropic 429 rate limit" ,
922+ last_error : { message : "Anthropic 429 rate limit" , retryable : true } ,
923923 } ) ;
924924
925925 const inputs = createMockInputs ( {
@@ -1413,7 +1413,7 @@ describe("CoderAgentChatAction", () => {
14131413 . mockResolvedValueOnce ( {
14141414 ...mockChat ,
14151415 status : "error" ,
1416- last_error : "agent crashed" ,
1416+ last_error : { message : "agent crashed" , retryable : false } ,
14171417 } ) ;
14181418
14191419 const existingChatId = "990e8400-e29b-41d4-a716-446655440000" ;
0 commit comments