[Bug] llm-pi-ai: hand-declared routes cannot disable the OpenAI "developer" system-prompt role — reasoning requests 400 on gateways that only accept "system" (e.g. Alibaba Cloud Model Studio / 阿里云百炼) #2587
Sherkirito
started this conversation in
General
Replies: 1 comment 1 reply
|
百炼这个场景的根因判断没问题。当前可以用“provider 自己拥有 transport”的方式绕过手写 dsh plugin --profile web add pi2dsh
dsh plugin --profile web add <能够直连该端点的 Pi provider 包>pi2dsh 会把它经 透传录制已验证:同一路径发出的是 |
1 reply
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.
现象 / Symptom
在
settings.yaml里手声明一个 OpenAI 兼容网关路由(api: openai-completions),并给模型声明reasoningEfforts(思考强度)后,所有请求以 400 失败:具体场景:阿里云百炼(Model Studio)MaaS 专属部署
https://ws-*.maas.aliyuncs.com/compatible-mode/v1,模型deepseek-v4-flash-0731/deepseek-v4-pro-0813,带reasoningEfforts: { off: null, high: high, max: max }。根因 / Root cause
convertMessages(openai-completions)里:const useDeveloperRole = model.reasoning && compat.supportsDeveloperRole—— 模型一旦声明了推理能力(model.reasoning = true),system 提示词就以 OpenAI 的role: "developer"发送。detectCompat对未知网关(ws-*.maas.aliyuncs.com不在任何已知名单里)默认supportsDeveloperRole: true。PiAiCompatProfile只暴露了thinkingFormat和supportsReasoningEffort,没有暴露supportsDeveloperRole,因此配置层无法关闭它 —— 手声明路由无法复刻内置 provider 的此开关。证据 / Evidence
直接探测网关(相同请求,仅 role 不同):
developerdeveloper is not one of [...]systemreasoning_content)上游已知此行为:pi-ai 内置的
qwen-token-plan-cnprovider(同为*.maas.aliyuncs.com域名)在模型数据里显式设置了compat.supportsDeveloperRole: false,说明阿里云 MaaS 网关只接受system角色,且上游已在内置目录中处理。手声明路由缺这个开关,无法做同样的处理。建议修复 / Suggested fix
给
PiAiCompatProfile(packages/llm/llm-pi-ai/src/catalog.ts+config.tsschema)增加supportsDeveloperRole?: boolean并在resolveModelCompat透传给 pi-ai。已在本地验证可行:临时绕法 / Workaround
不给模型声明
reasoningEfforts(回到无思考强度状态),或等官方补上该开关。环境:pi-ai 0.82.1,DSH 当前 master。
All reactions