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
This model does not support assistant message prefill / Github Copilot with Opus 4.6 #13768
Working with Opus 4.6, opencode frequently stops with the message "This model does not support assistant message prefill. The conversation must end with a user message."
This is from the session export:
{
"info": {
"role": "assistant",
"time": {
"created": 1771187182207,
"completed": 1771187184086
},
"error": {
"name": "APIError",
"data": {
"message": "This model does not support assistant message prefill. The conversation must end with a user message.",
"statusCode": 400,
"isRetryable": false,
"responseHeaders": {
"cache-control": "no-cache",
"content-security-policy": "default-src 'none'; sandbox",
"content-type": "text/plain; charset=utf-8",
"date": "Sun, 15 Feb 2026 20:26:23 GMT",
"strict-transport-security": "max-age=31536000",
"transfer-encoding": "chunked",
"x-content-type-options": "nosniff",
"x-github-backend": "Kubernetes",
"x-github-request-id": "EAAC:14EF1C:253883:31B9E3:69922BEC",
"x-request-id": "00000-ce7fe972-c41c-43ec-b02b-3d2299740ab9"
},
"responseBody": "{\"error\":{\"message\":\"This model does not support assistant message prefill. The conversation must end with a user message.\",\"code\":\"invalid_request_body\"}}\n",
"metadata": {
"url": "https://api.githubcopilot.com/chat/completions"
}
}
},
"parentID": "msg_c62f2be7600192uMJUKpSsJ0qr",
"modelID": "claude-opus-4.6",
"providerID": "github-copilot",
"mode": "build",
"agent": "build",
"path": {
"cwd": "/home/stefan/projects/odoo18",
"root": "/home/stefan/projects/odoo18"
},
"cost": 0,
"tokens": {
"input": 0,
"output": 0,
"reasoning": 0,
"cache": {
"read": 0,
"write": 0
}
},
"id": "msg_c62fb9a7f001Rl3UkWhXmVKLb7",
"sessionID": "ses_39d0d418cffeIz9g6wg7wg1Caj"
},
"parts": []
}
This issue appears to be a duplicate of an existing issue. Please check:
Github Copilot / Opus 4.6 Error #12337: Github Copilot / Opus 4.6 Error - reports the same "This model does not support assistant message prefill" error with Opus 4.6 on GitHub Copilot (already closed)
I can reproduce this issue and have identified the root cause: it's web-mode specific.
Key Finding
In opencode web mode, after each assistant response completes, OpenCode automatically sends a second, empty assistant turn (containing only step-start + step-finish, no text content). This phantom message causes the conversation to end with an assistant message, which then triggers the "assistant message prefill" error on the next request.
CLI/TUI mode does NOT have this problem — the same models work perfectly there.
(Full provider/model config is auto-generated by the antigravity auth plugin — the models themselves work fine in CLI mode, the issue is only in web mode generating phantom assistant messages.)
Note: The session was exported from SQLite directly since opencode export requires an active TUI session. The format matches the standard export structure with info + parts per message.
You are using antigravity models there and I dont see anything weird, I think there is a bug for that specific issue in the antigravity provider perhaps? Because it looks like u sent a message to opus 4.6 on antigravity, it replied, then u sent another and it errored.
Never mind my last comment. This is back. Not sure why this has been an issue for so long. Aren't anyone using Opus models not seeing this consistently? Is this something most are just living with by saying continue.
Asking to understand if this may be an environment specific bug, would make sense if its low priority then. From looking at the various similar open issues, looks like Google Vertex AI and GitHub Copilot also experience this not just AWS Bedrock.
undefined: The model returned the following errors: This model does not support assistant message prefill. The conversation must end with a user message.
Aren't anyone using Opus models not seeing this consistently? Is this something most are just living with by saying continue.
I see it constantly. Opus is not usable on OpenCode until this is fixed, at least for me. And yes, I used to say "proceed" to force it to retry, but even that didnt work reliably, I often had to switch model and then switch back. I switched to Kimi 2.6 in the meantime.
Interestingly, using Opus 4.7 through OpenRouter, the error message is different, it is now Provider returned error. When looking at the logs, I can see the root cause as:
HTTP 400 from OpenRouter (upstream: Anthropic)
"This model does not support assistant message prefill.
The conversation must end with a user message."
```.
I rebased #14772, as I suggested earlier, I think we can merge this PR as a temporary solution(if there is no proper solution soon), this issue has been here for too long, the PR itself should not have much side affects @rekram1-node
are there any plan to address this issue at all then? or it is fixed already? it has been quite a while already
Reacted by pedropinho7, Julio Souza, Tom Brandenburg, Shabinder Singh, Moritz Thomsen, Ville Viitaharju, Daniel Benjamin, Rory, ✦ freddie, Andrew Downey and 5 more
Activity
github-actions commentedon Feb 15, 2026
This issue appears to be a duplicate of an existing issue. Please check:
rekram1-node commentedon Feb 15, 2026
Can you share output of
opencode debug configsbrunecker commentedon Feb 15, 2026
hsuanguo commentedon Feb 15, 2026
I can confirm I have the same issue, with the latest opencode,
It was said that this feature is removed from opus 4.6 https://www.reddit.com/r/LLMDevs/comments/1r0ih5p/opus_removes_lastassistantturn_prefill_you_can_no/
rekram1-node commentedon Feb 16, 2026
Hm I cant replicate
rekram1-node commentedon Feb 16, 2026
can u send a session?
opencode export > session.jsonYiximail commentedon Feb 16, 2026
I can reproduce this issue and have identified the root cause: it's web-mode specific.
Key Finding
In
opencode webmode, after each assistant response completes, OpenCode automatically sends a second, empty assistant turn (containing onlystep-start+step-finish, no text content). This phantom message causes the conversation to end with an assistant message, which then triggers the "assistant message prefill" error on the next request.CLI/TUI mode does NOT have this problem — the same models work perfectly there.
Evidence from SQLite
Session
ses_39b0e7c9cffefZN9W4wuV6sIJx, message sequence:The phantom assistant messages have distinctive characteristics:
-0.0025166-2519750446(vs normal ~25000)step-start+step-finish, no text contentSteps to Reproduce
opencode web --port 4196Tested on v1.2.4 and v1.2.5, both reproduce in web mode only.
rekram1-node commentedon Feb 16, 2026
can u send the session? Can you show me
opencode debug configYiximail commentedon Feb 16, 2026
@rekram1-node Here's the session export and debug config:
Session export (220KB, uploaded as gist):
https://gist.github.com/Yiximail/c1881769ce64ed0ba693858314bd59f1
opencode debug config:{ "$schema": "https://opencode.ai/config.json", "plugin": [ "opencode-antigravity-auth@latest", "opencode-pty" ] }(Full provider/model config is auto-generated by the antigravity auth plugin — the models themselves work fine in CLI mode, the issue is only in web mode generating phantom assistant messages.)
Note: The session was exported from SQLite directly since
opencode exportrequires an active TUI session. The format matches the standard export structure withinfo+partsper message.Yiximail commentedon Feb 16, 2026
@rekram1-node Here's the full
opencode debug config:{ "$schema": "https://opencode.ai/config.json", "plugin": [ "opencode-antigravity-auth@latest", "opencode-pty" ], "provider": { "google": { "models": { "antigravity-gemini-3-pro": { "name": "Gemini 3 Pro (Antigravity)", "limit": { "context": 1048576, "output": 65535 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] }, "variants": { "low": { "thinkingLevel": "low" }, "high": { "thinkingLevel": "high" } } }, "antigravity-gemini-3-flash": { "name": "Gemini 3 Flash (Antigravity)", "limit": { "context": 1048576, "output": 65536 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] }, "variants": { "minimal": { "thinkingLevel": "minimal" }, "low": { "thinkingLevel": "low" }, "medium": { "thinkingLevel": "medium" }, "high": { "thinkingLevel": "high" } } }, "antigravity-claude-sonnet-4-5": { "name": "Claude Sonnet 4.5 (Antigravity)", "limit": { "context": 180000, "output": 64000 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] } }, "antigravity-claude-sonnet-4-5-thinking": { "name": "Claude Sonnet 4.5 Thinking (Antigravity)", "limit": { "context": 180000, "output": 64000 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] }, "variants": { "low": { "thinkingConfig": { "thinkingBudget": 8192 } }, "max": { "thinkingConfig": { "thinkingBudget": 32768 } } } }, "antigravity-claude-opus-4-5-thinking": { "name": "Claude Opus 4.5 Thinking (Antigravity)", "limit": { "context": 180000, "output": 64000 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] }, "variants": { "low": { "thinkingConfig": { "thinkingBudget": 8192 } }, "max": { "thinkingConfig": { "thinkingBudget": 32768 } } } }, "antigravity-claude-opus-4-6-thinking": { "name": "Claude Opus 4.6 Thinking (Antigravity)", "limit": { "context": 180000, "output": 64000 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] }, "variants": { "low": { "thinkingConfig": { "thinkingBudget": 8192 } }, "max": { "thinkingConfig": { "thinkingBudget": 32768 } } } }, "gemini-2.5-flash": { "name": "Gemini 2.5 Flash (Gemini CLI)", "limit": { "context": 1048576, "output": 65536 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] } }, "gemini-2.5-pro": { "name": "Gemini 2.5 Pro (Gemini CLI)", "limit": { "context": 1048576, "output": 65536 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] } }, "gemini-3-flash-preview": { "name": "Gemini 3 Flash Preview (Gemini CLI)", "limit": { "context": 1048576, "output": 65536 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] } }, "gemini-3-pro-preview": { "name": "Gemini 3 Pro Preview (Gemini CLI)", "limit": { "context": 1048576, "output": 65535 }, "modalities": { "input": ["text","image","pdf"], "output": ["text"] } } } } }, "mcp": { "playwright": { "type": "local", "command": ["npx", "-y", "@playwright/mcp@latest"], "enabled": true }, "brave-search": { "type": "local", "command": ["npx", "-y", "@brave/brave-search-mcp-server", "--transport", "stdio"], "environment": { "BRAVE_API_KEY": "[REDACTED]" }, "enabled": true }, "figma-mcp": { "type": "remote", "url": "https://mcp.figma.com/mcp", "enabled": true } }, "permission": { "external_directory": { "~/Documents/**": "allow", "~/.config/opencode/**": "allow" } } }The models are all injected by the
opencode-antigravity-authplugin. The issue reproduces across all of them in web mode.rekram1-node commentedon Feb 16, 2026
You are using antigravity models there and I dont see anything weird, I think there is a bug for that specific issue in the antigravity provider perhaps? Because it looks like u sent a message to opus 4.6 on antigravity, it replied, then u sent another and it errored.
55 remaining items
lteixeira-pcm commentedon May 4, 2026
Running into this a lot today myself - Opencode 1.14.33 + Opus 4.6 via
opencode web.J-Light commentedon May 12, 2026
I no longer seem to have this issues.
J-Light commentedon May 13, 2026
Never mind my last comment. This is back. Not sure why this has been an issue for so long. Aren't anyone using Opus models not seeing this consistently? Is this something most are just living with by saying
continue.Asking to understand if this may be an environment specific bug, would make sense if its low priority then. From looking at the various similar open issues, looks like Google Vertex AI and GitHub Copilot also experience this not just AWS Bedrock.
NewbiZ commentedon May 13, 2026
I see it constantly. Opus is not usable on OpenCode until this is fixed, at least for me. And yes, I used to say "proceed" to force it to retry, but even that didnt work reliably, I often had to switch model and then switch back. I switched to Kimi 2.6 in the meantime.
Frank-III commentedon May 16, 2026
Still encounter this issue using with anthropic api key. the subagent would early return and the main agent would behave poorly
wondering any workaround for this?
NewbiZ commentedon May 18, 2026
Interestingly, using Opus 4.7 through OpenRouter, the error message is different, it is now
Provider returned error. When looking at the logs, I can see the root cause as:J-Light commentedon May 20, 2026
In general I am seeing fewer issues with Opus 4.7 . I am carrying a patch manually for prefill errors
wstuckey commentedon May 29, 2026
Can confirm that this is still an issue for me as well
hsuanguo commentedon May 31, 2026
I rebased #14772, as I suggested earlier, I think we can merge this PR as a temporary solution(if there is no proper solution soon), this issue has been here for too long, the PR itself should not have much side affects @rekram1-node
hsuanguo commentedon Jul 3, 2026
are there any plan to address this issue at all then? or it is fixed already? it has been quite a while already
github-actions commentedon Sep 2, 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.
fake-name commentedon Sep 22, 2026
Well that bot is 100% useless and actively harmful.
soar commentedon Oct 2, 2026
This is still an issue and it still happens even on Opus 5.5