Skip to content

Bedrock Claude Opus 4.6 rejects assistant message prefill #29760

Closed as not planned

Description

@rodlaf

Summary

When using OpenCode with Claude Opus 4.6 on AWS Bedrock, requests can fail with:

undefined: The model returned the following errors: This model does not support assistant message prefill. The conversation must end with a user message.

Environment

  • Tool: OpenCode
  • Provider: AWS Bedrock
  • Model: Claude Opus 4.6
  • Error: This model does not support assistant message prefill. The conversation must end with a user message.

Expected behavior

OpenCode should avoid sending assistant message prefill when targeting Bedrock Anthropic models that do not support it.

Actual behavior

The Bedrock request is rejected because the conversation appears to end with an assistant message or assistant prefill.

Notes

This may require provider-specific handling for Bedrock Anthropic models, since assistant message prefill is not supported there even if it works with other Anthropic-compatible providers.

Activity

  1. github-actions commented on May 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The underlying problem (opencode sending a trailing assistant message to providers that don't support prefill) is the same across these reports, though your issue is specific to AWS Bedrock. It may be worth tracking this under one of the existing issues or linking to them.

  2. github-actions commented on Jul 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions