Skip to content

Conversation

@seanmcguire12
Copy link
Member

@seanmcguire12 seanmcguire12 commented Dec 23, 2025

why

what changed

  • Strip Anthropic’s beta-only caller field from tool_use blocks before persisting conversation history so subsequent beta.messages.create calls don’t send invalid keys.
  • The _process_provider_response path now model_dump()s each response.content block, removes caller, and falls back gracefully if serialization fails.
  • Fix ensures Stagehand agents can complete multi-step Claude sessions without the 400 "messages.*.tool_use.caller: Extra inputs are not permitted" error

test plan


Summary by cubic

Strip Anthropic’s beta-only caller field from tool_use blocks when saving conversation history, so we don’t resend invalid keys on the next call. Fixes the 400 “messages.*.tool_use.caller: Extra inputs are not permitted” error in multi-step Claude sessions (addresses #249).

  • Bug Fixes
    • In _process_provider_response, serialize each content block, remove caller, and handle serialization failures gracefully.
    • Prevent invalid keys in beta.messages.create to keep multi-step sessions running.

Written for commit cfcca94. Summary will update automatically on new commits.

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to revert this?

Copy link
Member Author

Choose a reason for hiding this comment

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

ya my bad. done

@seanmcguire12 seanmcguire12 merged commit 898a2fd into main Dec 23, 2025
31 of 34 checks passed
@github-actions github-actions bot mentioned this pull request Dec 23, 2025
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.

3 participants