Skip to content

FIX: Replay content-filtered turns as text in the Responses and AzureML targets - #4160

Open
Utkarsh Bahuguna (u7k4rs6) wants to merge 1 commit into
microsoft:mainfrom
u7k4rs6:fix/blocked-turn-history
Open

Utkarsh Bahuguna (u7k4rs6) wants to merge 1 commit into
microsoft:mainfrom
u7k4rs6:fix/blocked-turn-history

Conversation

@u7k4rs6

Copy link
Copy Markdown
Contributor

A content-filtered response is stored as an error piece with response_error="blocked" and stays in history, but OpenAIResponseTarget and ChatMessageNormalizer (used by AzureMLChatTarget) rejected error pieces, so the next turn in that conversation always raised before reaching the provider. Now both replay a blocked piece as text, assistant output_text on Responses and a text part in the normalizer, which matches what OpenAIChatTarget already does. Processing and unknown errors are still rejected like before.

The new tests send a filtered turn and then a follow-up through PromptNormalizer on each target and check the second request carries the blocked turn as text, plus normalizer tests for single and multipart blocked pieces and that processing and unknown errors still raise. They fail on main and pass here.

Fixes #4155

Copilot AI balanced review requested due to automatic review settings November 10, 2026 15:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

No deployments
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.

BUG: One content-filtered turn breaks the rest of the conversation on OpenAIResponseTarget and AzureMLChatTarget

2 participants