Summary
I used CC-Switch to have added a custom model api for OpenCode. I can interact in opencode cli with the model correctly. However, it does not work in OpenWork when using the model api. It just shows as below:
System message must be at the beginning.
Status: 400
Response: {"error":{"message":"System message must be at the beginning.","type":"BadRequestError","param":null,"code":400}}
To Reproduce
envs:
- MacOS
- OpenCode: 1.16.2
- OpenWork: v0.15.2
- CC-Switch: 3.16.1
- API Format: OpenAI Compatible
- Base URL: http://[my model IP]:[PORT]/v1
steps:
- cd to/your_project_dir
- use
opencode to activate opencode and change the model to the one I just added, and start conversation. Everything goes right. /exit it.
- start OpenWork and make sure the customized provider and model are connected. Enter anything in TUI, and you will be responsed with the error.
Expected behavior
OpenWork did recognize the config of OpenCode and the customized model api.
OpenCode CLI works normally as well as OpenWork desktop app.
Actual behavior
OpenCode CLI works normally while OpenWork throws an exception.
Screenshots (optional)
OW version & Desktop info (optional)
No response
Additional context (optional)
No response
Summary
I used CC-Switch to have added a custom model api for OpenCode. I can interact in opencode cli with the model correctly. However, it does not work in OpenWork when using the model api. It just shows as below:
System message must be at the beginning.
Status: 400
Response: {"error":{"message":"System message must be at the beginning.","type":"BadRequestError","param":null,"code":400}}
To Reproduce
envs:
steps:
opencodeto activate opencode and change the model to the one I just added, and start conversation. Everything goes right./exitit.Expected behavior
OpenWork did recognize the config of OpenCode and the customized model api.
OpenCode CLI works normally as well as OpenWork desktop app.
Actual behavior
OpenCode CLI works normally while OpenWork throws an exception.
Screenshots (optional)
OW version & Desktop info (optional)
No response
Additional context (optional)
No response