OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: Azure o1 and o1-preview error Unsupported value: 'messages[0].role' does not support 'system' with this model

Open rw-MohamedAbouseif opened this issue 1 year ago • 1 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Describe the bug and reproduction steps

If you choose your deployed model as Azure o1 or o1-preview and run the agent with any request.

You get the following error:

litellm.BadRequestError: AzureException BadRequestError - Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'system' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}

Docker is installed on windows and container is launched from within WSL. Exact issue: https://github.com/All-Hands-AI/OpenHands/issues/4839

OpenHands Installation

Docker command in README

OpenHands Version

0.20.0 - 2025-01-13

Operating System

WSL on Windows

Logs, Errors, Screenshots, and Additional Context

litellm.BadRequestError: AzureException BadRequestError - Error code: 400 - {'error': {'message': "Unsupported value: 'messages[0].role' does not support 'system' with this model.", 'type': 'invalid_request_error', 'param': 'messages[0].role', 'code': 'unsupported_value'}}

rw-MohamedAbouseif avatar Jan 15 '25 08:01 rw-MohamedAbouseif

The other day this issue on recognizing o1 models on Azure was fixed in litellm. Once o1 is recognized, it means that litellm will apply transformations like replacement of the system prompt with a user message, so that it works normally.

I'll test their release with the fix. I'm not sure why it happens on o1-preview too, though.

enyst avatar Jan 15 '25 09:01 enyst

@enyst any updates from your testing? thanks

rw-MohamedAbouseif avatar Jan 17 '25 10:01 rw-MohamedAbouseif

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Feb 17 '25 02:02 github-actions[bot]

@rw-MohamedAbouseif Sorry for the delay on answering. This was fixed a while ago. I will close this, but if you see it again on any model, please feel free to reopen.

enyst avatar Feb 17 '25 11:02 enyst