Skip to content

Provider request fails with assistant message prefill error on some models #19981

Closed as not planned

Description

@OpenCodeEngineer

Problem

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.

Activity

  1. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    This issue has been automatically closed.

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 30, 2026
  3. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • 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:

    If you believe this was flagged incorrectly, please let a maintainer know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions