Skip to content

fix: serialize Claude tool-use round trips with Anthropic message blocks #3056

Description

@auyua9

Claude tool-use round trips need Anthropic-native message blocks

ReActAgent appends an assistant message containing tool_calls and one or more tool-result messages before the next provider request. ClaudeProvider.generate() currently serializes those messages with the generic OpenAI-shaped Message.to_dict() payload (tool_calls on the assistant and role: tool for results). Anthropic Messages API expects tool_use blocks on the assistant turn and tool_result blocks inside a user turn.

This issue tracks a focused fix to serialize the existing provider-neutral messages into the Anthropic wire format and cover the round trip with unit tests.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions