File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
web/src/app/api/v1/chat/completions Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -53,20 +53,21 @@ export async function POST(req: NextRequest) {
5353 )
5454 }
5555
56- const runIdFromBody = body . codebuff_metadata ?. agentRunId
57- if ( ! runIdFromBody ) {
56+ const runIdFromBody : string = body . codebuff_metadata ?. agentRunId
57+ if ( ! runIdFromBody || typeof runIdFromBody !== 'string' ) {
5858 return NextResponse . json (
59- { message : 'No agent run ID found in request body' } ,
59+ { message : 'No agentRunId found in request body' } ,
6060 { status : 400 }
6161 )
6262 }
63+
6364 const runId = runIdFromBody
6465 ? getAgentRunFromId ( { agentRunId : runIdFromBody , userId, fields : [ 'id' ] } )
6566 : null
6667 if ( ! runId ) {
6768 return NextResponse . json (
68- { message : `Agent Run ID Not Found: ${ runIdFromBody } ` } ,
69- { status : 404 }
69+ { message : `agentRunId Not Found: ${ runIdFromBody } ` } ,
70+ { status : 400 }
7071 )
7172 }
7273
You can’t perform that action at this time.
0 commit comments