Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Fix: strip tool_search messages from summarization to prevent tool_reference errors#4999

Merged
bhavyaus merged 1 commit into
release/0.43from
dev/bhavyau/fix-tool-reference-summarization-0.43
Apr 6, 2026
Merged

Fix: strip tool_search messages from summarization to prevent tool_reference errors#4999
bhavyaus merged 1 commit into
release/0.43from
dev/bhavyau/fix-tool-reference-summarization-0.43

Conversation

@bhavyaus
Copy link
Copy Markdown
Contributor

@bhavyaus bhavyaus commented Apr 6, 2026

Cherry-pick of #4993 into release/0.43.

Problem

Full mode summarization fails on Anthropic models with:
Input tag 'tool_reference' found using 'type' does not match any of the expected tags: 'document', 'image', 'search_result'

Fix

Strip custom tool_search tool_use/tool_result pairs from the summarization messages before they reach makeChatRequest2createMessagesRequestBody. This prevents tryParseToolReferences from converting the JSON text content to tool_reference blocks that Anthropic rejects.

…ference errors

The summarization call uses ChatLocation.Other but createMessagesRequestBody
still converts custom tool_search results to tool_reference blocks because
customToolSearchEnabled isn't gated by isAllowedConversationAgent. Without
tool search enabled in the summarization request, Anthropic rejects
tool_reference content blocks.

Strip tool_search tool_use/tool_result pairs from messages before sending
the summarization request.
@bhavyaus bhavyaus merged commit 4b9c9b5 into release/0.43 Apr 6, 2026
19 checks passed
@bhavyaus bhavyaus deleted the dev/bhavyau/fix-tool-reference-summarization-0.43 branch April 6, 2026 18:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants