Skip to content

Validation: Fix conversation.id format #916

Description

@sentry

Describe the bug you are facing
We are encountering a BadRequestError due to an invalid conversation.id format. This issue prevents proper API calls, leading to workflow interruptions.
Sentry Issue: KAAPI-PRODUCTION-B

BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'conversation.id': '@results.llm_thread_id.input'. Expected an ID that contains letters, numbers, underscores, or dashes, but this value contained additional characters.", 'type': 'invalid_request_error', 'param': 'conversation.id', 'code': 'invalid_value'}}
  File "openai/resources/responses/responses.py", line 898, in create
    return self._post(
  File "openai/_base_client.py", line 1297, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
  File "openai/_base_client.py", line 1070, in request
    raise self._make_status_error_from_response(err.response) from None

Describe the solution you'd like

  • Validate the conversation.id to ensure it follows OpenAI conventions before making an API call to OpenAI
  • Provide a meaningful error message and status code so this can be handled gracefully by a platform like Glific in their flows

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions