Skip to content

Conversation

@psousa50
Copy link

@psousa50 psousa50 commented Dec 10, 2025

Summary

  • Filters tool_use blocks to only include fields that Anthropic accepts in requests: type, id, name, and input
  • Prevents agent failures on step 2+ caused by the caller field being rejected

Problem

Anthropic's API returns a caller field in tool_use response blocks (introduced with programmatic tool calling), but rejects this field when sent back in subsequent requests. The current model_dump() preserves all fields, causing validation errors.

Test plan

  • Unit tests pass
  • Manual test with multi-step agent execution

🤖 Generated with Claude Code


Summary by cubic

Strip unsupported fields from tool_use blocks before sending to Anthropic to prevent validation errors and multi-step agent failures. Only type, id, name, and input are kept; caller is removed.

Written for commit 69ef3f5. Summary will update automatically on new commits.

…I rejection

Anthropic's API returns a `caller` field in `tool_use` response blocks
but rejects this field when sent back in subsequent requests. This
filters `tool_use` blocks to only include accepted fields: `type`, `id`,
`name`, and `input`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant