Replies: 1 comment
|
Landed a dsh-side fix (rather than patching node_modules):
This is your option 3 (config flag), which is the durable one: option 1 (grow the domain list) never ends, and option 2 (invert the default) breaks providers that do support it. The flag lets each endpoint state the truth. llm-pi-ai suite 210/210. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Title: [Bug] Custom providers via OpenAI-compatible endpoint return HTTP 400: developer is not one of ['system','assistant','user','tool','function']
Body:
Summary
When adding a custom provider through an OpenAI-compatible endpoint (e.g.
Volcengine Ark
https://ark.cn-beijing.volces.com/api/v3or AlibabaDashScope/Bailian
https://dashscope.aliyuncs.com/compatible-mode/v1), thefirst request fails with:400 {"error":{"code":"invalid_parameter_error","param":null,
"message":"developer is not one of ['system', 'assistant', 'user', 'tool', 'function']",
"type":"invalid_request_error"}}
Environment
@deepseek-ai/dsh)doubao-seed-2.1-turbo,DashScope
qwen3.7-max, etc.)Root cause
dsh routes model requests through
@earendil-works/pi-ai'sopenai-completionsadapter. Indist/api/openai-completions.js,supportsDeveloperRoleis computed as:Workaround (verified)
Patch node_modules/@deepseek-ai/dsh/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js line ~1148:
After restarting dsh, the model works (pi-ai falls back to the system role).
Suggested fix
Add domestic cloud domains (volces.com, aliyuncs.com, bigmodel.cn,
baidubce.com, etc.) to the isNonStandard list — minimal change; OR
Better: invert the default — only treat endpoints pi-ai explicitly knows
(official OpenAI/Anthropic/...) as supportsDeveloperRole-capable, and
default custom endpoints to false (safe for all OpenAI-compatible
third-party APIs); ORExpose a config flag (e.g. supportsDeveloperRole) per model/provider so
users can opt in/out without editing node_modules.
All reactions