mirror of
https://github.com/elastic/kibana.git
synced 2025-04-22 00:45:43 -04:00
## Summary BUG: https://github.com/elastic/security-team/issues/11783 This PR fixes the behaviour of the `/api/security_ai_assistant/chat/complete` route where the `conversationId` can be passed as an empty string. This may lead to unexpected results described in https://github.com/elastic/security-team/issues/11783#issuecomment-2696529040. ### Expected behaviour We should throw a bad request (400) http error when empty `conversationId` has been passed. ### Testing * Use this `curl` command to test the endpoint. ``` curl --location 'http://localhost:5601/api/security_ai_assistant/chat/complete' \ --header 'kbn-xsrf: true' \ --header 'Content-Type: application/json' \ --data '{ "connectorId": "{{my-gpt4o-ai}}", "conversationId": "", "isStream": false, "messages": [ { "content": "Follow up", "role": "user" } ], "persist": true }' ``` You should see next error as a response: ``` { "statusCode": 400, "error": "Bad Request", "message": "[request body]: conversationId: String must contain at least 1 character(s), conversationId: No empty strings allowed" } ``` --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
kibana.serverless.yaml | ||
kibana.yaml |