Skip to content

[upstream #17201] Strip assistant prefill for Claude 4.6+ on Bedrock in the agents client #398

Open

Description

@berry-13

@librechat/agents strips a trailing assistant prefill only in CustomAnthropic (direct Anthropic and Vertex). LibreChat-AI/agents#621 widened that gate to Claude 4.6 and every later release, but CustomChatBedrockConverse (src/llm/bedrock/index.ts) never calls it: the stream, the local non-streaming converter and the inherited non-streaming path all send the converted messages as is. A Bedrock request for Claude 4.6+ or any 5.x model (anthropic.claude-sonnet-4-6, us.anthropic.claude-opus-5-5-v1:0, global.anthropic.claude-haiku-5-5, and application inference profiles over them) whose history ends with an assistant turn is rejected with a 400. Reproduces on agents main (v4.0.6) independent of LibreChat-AI#17201.

Fix in the agents SDK: apply the same modelDisallowsAssistantPrefill gate on the Bedrock Converse path, re-anchoring a tail cache point that rode the stripped message, and leave non-Anthropic Bedrock models untouched. Then bump @librechat/agents in LibreChat.

Activity

  1. added
    bugSomething isn't working
    readyreviewctl followups state
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagesreviewctl followups statebugSomething isn't workingreadyreviewctl followups state

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions