Skip to content

fix(coderd/x/chatd/chatsanitize): sanitize web_search history for non-Anthropic providers#25593

Draft
ibetitsmike wants to merge 1 commit into
mainfrom
michaelsuchacz/codagt-471-sanitize-web-search-tool-results-for-bedrock-provider-376a
Draft

fix(coderd/x/chatd/chatsanitize): sanitize web_search history for non-Anthropic providers#25593
ibetitsmike wants to merge 1 commit into
mainfrom
michaelsuchacz/codagt-471-sanitize-web-search-tool-results-for-bedrock-provider-376a

Conversation

@ibetitsmike
Copy link
Copy Markdown
Collaborator

Switching providers mid-chat from Anthropic to Bedrock currently fails because Bedrock shares the Anthropic message format but rejects web_search_tool_result blocks with HTTP 400.

Add SanitizeUnsupportedProviderToolHistory which strips Anthropic provider-executed tool calls and converts their results to plain text whenever the target provider is not Anthropic. Wired in alongside the existing Anthropic sanitization in the chatloop pre-request path and in chatd's persisted/reloaded history replay paths.

…-Anthropic providers

Bedrock shares Anthropic's message format but rejects
web_search_tool_result blocks with HTTP 400, so switching from
Anthropic to Bedrock mid-chat fails. Strip provider-executed
tool calls and convert results to text when the target provider
is not Anthropic.
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