@@ -95,6 +95,76 @@ describe('OnlineEvalConfigPrimitive', () => {
9595 expect ( config . enableOnCreate ) . toBeUndefined ( ) ;
9696 } ) ;
9797
98+ it ( 'persists sessionTimeoutMinutes when provided' , async ( ) => {
99+ mockReadProjectSpec . mockResolvedValue ( makeProject ( ) ) ;
100+ mockWriteProjectSpec . mockResolvedValue ( undefined ) ;
101+
102+ const result = await primitive . add ( {
103+ name : 'WithTimeout' ,
104+ agent : 'MyAgent' ,
105+ evaluators : [ 'Builtin.GoalSuccessRate' ] ,
106+ samplingRate : 10 ,
107+ sessionTimeoutMinutes : 30 ,
108+ } ) ;
109+
110+ expect ( result . success ) . toBe ( true ) ;
111+ const config = mockWriteProjectSpec . mock . calls [ 0 ] ! [ 0 ] . onlineEvalConfigs [ 0 ] ;
112+ expect ( config . sessionTimeoutMinutes ) . toBe ( 30 ) ;
113+ } ) ;
114+
115+ it ( 'omits sessionTimeoutMinutes when not provided' , async ( ) => {
116+ mockReadProjectSpec . mockResolvedValue ( makeProject ( ) ) ;
117+ mockWriteProjectSpec . mockResolvedValue ( undefined ) ;
118+
119+ await primitive . add ( {
120+ name : 'NoTimeout' ,
121+ agent : 'MyAgent' ,
122+ evaluators : [ 'Builtin.GoalSuccessRate' ] ,
123+ samplingRate : 10 ,
124+ } ) ;
125+
126+ const config = mockWriteProjectSpec . mock . calls [ 0 ] ! [ 0 ] . onlineEvalConfigs [ 0 ] ;
127+ expect ( config . sessionTimeoutMinutes ) . toBeUndefined ( ) ;
128+ } ) ;
129+
130+ it ( 'persists filters when provided' , async ( ) => {
131+ mockReadProjectSpec . mockResolvedValue ( makeProject ( ) ) ;
132+ mockWriteProjectSpec . mockResolvedValue ( undefined ) ;
133+
134+ const filters = [
135+ { key : 'userId' , operator : 'Equals' as const , value : { stringValue : 'abc' } } ,
136+ { key : 'score' , operator : 'GreaterThan' as const , value : { doubleValue : 0.5 } } ,
137+ ] ;
138+
139+ const result = await primitive . add ( {
140+ name : 'WithFilters' ,
141+ agent : 'MyAgent' ,
142+ evaluators : [ 'Builtin.GoalSuccessRate' ] ,
143+ samplingRate : 10 ,
144+ filters,
145+ } ) ;
146+
147+ expect ( result . success ) . toBe ( true ) ;
148+ const config = mockWriteProjectSpec . mock . calls [ 0 ] ! [ 0 ] . onlineEvalConfigs [ 0 ] ;
149+ expect ( config . filters ) . toEqual ( filters ) ;
150+ } ) ;
151+
152+ it ( 'omits filters when an empty array is provided' , async ( ) => {
153+ mockReadProjectSpec . mockResolvedValue ( makeProject ( ) ) ;
154+ mockWriteProjectSpec . mockResolvedValue ( undefined ) ;
155+
156+ await primitive . add ( {
157+ name : 'EmptyFilters' ,
158+ agent : 'MyAgent' ,
159+ evaluators : [ 'Builtin.GoalSuccessRate' ] ,
160+ samplingRate : 10 ,
161+ filters : [ ] ,
162+ } ) ;
163+
164+ const config = mockWriteProjectSpec . mock . calls [ 0 ] ! [ 0 ] . onlineEvalConfigs [ 0 ] ;
165+ expect ( config . filters ) . toBeUndefined ( ) ;
166+ } ) ;
167+
98168 it ( 'supports multiple evaluators including ARNs' , async ( ) => {
99169 mockReadProjectSpec . mockResolvedValue ( makeProject ( ) ) ;
100170 mockWriteProjectSpec . mockResolvedValue ( undefined ) ;
0 commit comments