@@ -66,14 +66,14 @@ describe('/api/v1/chat/completions POST endpoint', () => {
6666 }
6767 } )
6868
69- mockGetAgentRunFromId = mock ( ( async ( { agentRunId } : any ) => {
70- if ( agentRunId === 'run-123' ) {
69+ mockGetAgentRunFromId = mock ( ( async ( { runId } : any ) => {
70+ if ( runId === 'run-123' ) {
7171 return {
7272 agent_id : 'agent-123' ,
7373 status : 'running' ,
7474 }
7575 }
76- if ( agentRunId === 'run-completed' ) {
76+ if ( runId === 'run-completed' ) {
7777 return {
7878 agent_id : 'agent-123' ,
7979 status : 'completed' ,
@@ -229,7 +229,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
229229 expect ( body ) . toEqual ( { message : 'Invalid JSON in request body' } )
230230 } )
231231
232- it ( 'returns 400 when agent_run_id is missing' , async ( ) => {
232+ it ( 'returns 400 when run_id is missing' , async ( ) => {
233233 const req = new NextRequest (
234234 'http://localhost:3000/api/v1/chat/completions' ,
235235 {
@@ -252,7 +252,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
252252
253253 expect ( response . status ) . toBe ( 400 )
254254 const body = await response . json ( )
255- expect ( body ) . toEqual ( { message : 'No agentRunId found in request body' } )
255+ expect ( body ) . toEqual ( { message : 'No runId found in request body' } )
256256 } )
257257
258258 it ( 'returns 400 when agent run not found' , async ( ) => {
@@ -263,7 +263,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
263263 headers : { Authorization : 'Bearer test-api-key-123' } ,
264264 body : JSON . stringify ( {
265265 stream : true ,
266- codebuff_metadata : { agent_run_id : 'run-nonexistent' } ,
266+ codebuff_metadata : { run_id : 'run-nonexistent' } ,
267267 } ) ,
268268 } ,
269269 )
@@ -282,7 +282,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
282282 expect ( response . status ) . toBe ( 400 )
283283 const body = await response . json ( )
284284 expect ( body ) . toEqual ( {
285- message : 'agentRunId Not Found: run-nonexistent' ,
285+ message : 'runId Not Found: run-nonexistent' ,
286286 } )
287287 } )
288288
@@ -294,7 +294,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
294294 headers : { Authorization : 'Bearer test-api-key-123' } ,
295295 body : JSON . stringify ( {
296296 stream : true ,
297- codebuff_metadata : { agent_run_id : 'run-completed' } ,
297+ codebuff_metadata : { run_id : 'run-completed' } ,
298298 } ) ,
299299 } ,
300300 )
@@ -313,7 +313,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
313313 expect ( response . status ) . toBe ( 400 )
314314 const body = await response . json ( )
315315 expect ( body ) . toEqual ( {
316- message : 'agentRunId Not Running: run-completed' ,
316+ message : 'runId Not Running: run-completed' ,
317317 } )
318318 } )
319319 } )
@@ -327,7 +327,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
327327 headers : { Authorization : 'Bearer test-api-key-no-credits' } ,
328328 body : JSON . stringify ( {
329329 stream : true ,
330- codebuff_metadata : { agent_run_id : 'run-123' } ,
330+ codebuff_metadata : { run_id : 'run-123' } ,
331331 } ) ,
332332 } ,
333333 )
@@ -362,7 +362,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
362362 body : JSON . stringify ( {
363363 stream : true ,
364364 codebuff_metadata : {
365- agent_run_id : 'run-123' ,
365+ run_id : 'run-123' ,
366366 client_id : 'test-client-id-123' ,
367367 client_request_id : 'test-client-session-id-123' ,
368368 } ,
@@ -400,7 +400,7 @@ describe('/api/v1/chat/completions POST endpoint', () => {
400400 body : JSON . stringify ( {
401401 stream : false ,
402402 codebuff_metadata : {
403- agent_run_id : 'run-123' ,
403+ run_id : 'run-123' ,
404404 client_id : 'test-client-id-123' ,
405405 client_request_id : 'test-client-session-id-123' ,
406406 } ,
0 commit comments