You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When using the qwen3.5-122b-a10b model (via nvidia provider), the following error is returned: System message must be at the beginning #16560
Configure opencode.json to use nvidia provider with qwen3.5-122b-a10b model
Start opencode and try to interact with the model
Error occurs: System message must be at the beginning
Workarounds Attempted
Added the following configuration in opencode.json:
{
"nvidia": {
"models": {
"qwen/qwen3.5-122b-a10b": {
"chat_template_kwargs": {
"enable_system_prompt": true
}
}
}
}
}
But the problem persists.
Expected Behavior
The model should be able to receive and process system prompts normally without returning an error.
Additional Information
Error occurs every time (100% reproducibility)
Other models (e.g., glm-4.7, doubao-seed-2.0-code) work fine with this provider
Have not tried direct curl calls to nvidia API yet
This issue might be a duplicate of existing issues. Please check:
Duplicate System Message Sent #1301: Duplicate System Message Sent — OpenCode sends multiple system messages; certain models (like the NVIDIA-hosted Qwen model) reject requests where the system message is not at the very beginning or is duplicated.
same bug as #15059. @paulgear's #15018 was the right shape, and #16981 (currently open and awaiting code-owner review) generalizes it with a capability flag.
still broken on opencode v1.14.39 against Qwen/Qwen3.6-27B and Qwen/Qwen3.6-35B-A3B on vLLM v0.21.0, even with no plugins — the title-generator path produces [system, system, user] on its own. running the equivalent of #15018 locally resolves the 400s without affecting any other provider.
const server = http.createServer((req, res) => {
// We only need to modify chat completions.
if (
req.method === "POST" &&
req.url.startsWith("/v1/chat/completions")
) {
let body = "";
Activity
github-actions commentedon Mar 8, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is the same underlying problem, consider adding a comment or reaction there rather than opening a new report.
paulgear commentedon Mar 8, 2026
This is a dup of #5034 (and possibly a recurrence of #1301), and I've produced a PR #15018 to fix it. Please add your upvote so it can get merged.
brainwang commentedon Apr 10, 2026
Any workaround?
sgmihai commentedon Apr 16, 2026
qwen3.6 32b in vllm, getting this message in opencode + omo slim, every now and then
robertoberto commentedon May 23, 2026
same bug as #15059. @paulgear's #15018 was the right shape, and #16981 (currently open and awaiting code-owner review) generalizes it with a capability flag.
still broken on opencode v1.14.39 against Qwen/Qwen3.6-27B and Qwen/Qwen3.6-35B-A3B on vLLM v0.21.0, even with no plugins — the title-generator path produces [system, system, user] on its own. running the equivalent of #15018 locally resolves the 400s without affecting any other provider.
diagnosis + repro in #15059.
github-actions commentedon Jul 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
brusacco commentedon Aug 16, 2026
Build a little proxy in Node to fix this issue; this is happening now on Qwen 3.8
`const http = require("http");
const PORT = 11435;
const OLLAMA_HOST = "192.168.0.32";
const OLLAMA_PORT = 11434;
/**
*/
function mergeSystemMessages(messages) {
if (!Array.isArray(messages)) {
return messages;
}
}
const server = http.createServer((req, res) => {
// We only need to modify chat completions.
if (
req.method === "POST" &&
req.url.startsWith("/v1/chat/completions")
) {
let body = "";
});
server.listen(PORT, "0.0.0.0", () => {
console.log(
Qwen/OpenCode proxy listening on :${PORT});console.log(
Forwarding to http://${OLLAMA_HOST}:${OLLAMA_PORT});
});`