@@ -19,9 +19,11 @@ describe('isThreadDepthError', () => {
1919 expect ( isThreadDepthError ( new Error ( 'prefix AI-217 suffix' ) ) ) . toBe ( true ) ;
2020 } ) ;
2121
22- it ( 'detects thread depth phrasing without code' , ( ) => {
23- expect ( isThreadDepthError ( new Error ( 'Thread depth exceeded' ) ) ) . toBe ( true ) ;
24- expect ( isThreadDepthError ( new Error ( 'thread depth limit reached' ) ) ) . toBe ( true ) ;
22+ it ( 'detects conversation depth phrasing without code' , ( ) => {
23+ expect (
24+ isThreadDepthError ( new Error ( "You've hit the max conversation depth (4 messages), start a new conversation." ) ) ,
25+ ) . toBe ( true ) ;
26+ expect ( isThreadDepthError ( new Error ( 'Maximum conversation depth reached.' ) ) ) . toBe ( true ) ;
2527 } ) ;
2628
2729 it ( 'detects AI-217 in JSON-shaped error bodies' , ( ) => {
@@ -68,10 +70,10 @@ describe('filterExchangesForThreadDepthError', () => {
6870describe ( 'getThreadDepthErrorUserFacingMessage' , ( ) => {
6971 it ( 'returns nested message from JSON-shaped thread depth errors' , ( ) => {
7072 const body = JSON . stringify ( {
71- message : 'Conversation has reached its maximum thread depth of 3 messages. Please start a new conversation.' ,
73+ message : "You've hit the max conversation depth (4 messages), start a new conversation." ,
7274 } ) ;
7375 expect ( getThreadDepthErrorUserFacingMessage ( new Error ( body ) ) ) . toBe (
74- 'Conversation has reached its maximum thread depth of 3 messages. Please start a new conversation.' ,
76+ "You've hit the max conversation depth (4 messages), start a new conversation." ,
7577 ) ;
7678 } ) ;
7779
0 commit comments