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
Provider request fails with assistant message prefill error on some models #19981
I regularly hit this runtime error when sending messages with certain models:
This model does not support assistant message prefill. The conversation must end with a user message.
Expected behavior
OpenCode should avoid sending assistant-prefill style message payloads to providers/models that do not support it, or automatically normalize the message list so the final message is user-authored before request dispatch.
Actual behavior
Request fails and the session gets blocked by the provider error.
Why this matters
This is a recurring production UX issue for model/provider combinations with strict message-shape requirements.
Suggested direction
Detect provider/model prefill support capability.
When unsupported, strip/adjust assistant prefill before API call.
Add regression coverage for message-shape normalization across providers.
Error text
This model does not support assistant message prefill. The conversation must end with a user message.
No issue template was used. Please use one of the three required templates: Bug Report, Feature Request, or Question. Bug reports require a Description field with reproduction context using the standard template format.
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
Activity
github-actions commentedon Mar 30, 2026
This issue has been automatically closed.
github-actions commentedon Mar 30, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
finish=stop, triggering prefill error on claude-opus-4-6 #17982: Bug: OpenCode prompt loop continues afterfinish=stop, triggering prefill error on claude-opus-4-6If you believe this was flagged incorrectly, please let a maintainer know.