Skip to content

Tool calls fail on Claude 4.6 models #4020

@jcbjoe

Description

@jcbjoe

pipecat version

0.0.105

Python version

3.11.5

Operating System

MacOS 26.2

Issue description

The new Anthropic Sonnet 4.6 does not support assistant prefilling. This causes tool calls to fail with the following error:

PipelineTask#1: Something went wrong: ErrorFrame#0(error: Unknown error occurred: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'}, 'request_id': ''}, fatal: False)

A workaround for this is to append a blank message to the llm request before it is sent and is the solution the LiveKit team opted for: livekit/agents#4973

Reproduction steps

Use a tool call with a claud 4.6 model (Opus or Sonnet)

Expected behavior

No errors and the flow work as expected

Actual behavior

Pipeline crashes

Logs

PipelineTask#1: Something went wrong: ErrorFrame#0(error: Unknown error occurred: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'This model does not support assistant message prefill. The conversation must end with a user message.'}, 'request_id': 'req_011CYzCWrrmTBzStvAz2XWKE'}, fatal: False)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions