Bug Description
插件通过 output.system.push(prompt) 往 system 数组里追加了 repo context。但某些 LLM provider(比如通过 litellm
代理到 OpenAI)要求 所有 system message 必须在消息列表的最前面,且只能有一个 system message 块。
当插件注入的 system prompt 和原来的 system message 合并时,消息列表的实际顺序变成了:
1. system(原始)
2. system(repoContext 注入的) ← 排在中间
3. user
4. assistant
5. ...
OpenAI API 看到 system message 不在第一条(或者出现在 user/assistant 之后),直接报错:
System message must be at the beginning
根本原因: opencode 的 experimental.chat.system.transform 这个 hook 的设计,在某些 provider
的消息序列化逻辑下,会把注入的 system prompt 放到消息序列的中间位置,而不是正确地合并到最前面的 system
块中。这是 opencode 框架和 litellm/OpenAI 之间的一个兼容性问题。
Steps to Reproduce
我使用liteLLM 后插件打开repoContext功能也能正常使用
Expected Behavior
我使用liteLLM 后插件打开repoContext功能也能正常使用
Actual Behavior
我使用liteLLM 后插件打开repoContext功能也能正常使用
Minimal Reproducible Example
Error Logs
OpenViking Version
0.4.6
Python Version
3.12.5
Operating System
Windows
Model Backend
None
Additional Context
No response
Bug Description
插件通过 output.system.push(prompt) 往 system 数组里追加了 repo context。但某些 LLM provider(比如通过 litellm
代理到 OpenAI)要求 所有 system message 必须在消息列表的最前面,且只能有一个 system message 块。
Steps to Reproduce
我使用liteLLM 后插件打开repoContext功能也能正常使用
Expected Behavior
我使用liteLLM 后插件打开repoContext功能也能正常使用
Actual Behavior
我使用liteLLM 后插件打开repoContext功能也能正常使用
Minimal Reproducible Example
Error Logs
OpenViking Version
0.4.6
Python Version
3.12.5
Operating System
Windows
Model Backend
None
Additional Context
No response