chore: sync main hotfix (v2.0.4) into dev#252
Merged
Conversation
…tGenerator max_tokens (Bug #43771) Two-part fix for the Design step failure 'The model produced invalid content': 1. Add 'model produced invalid content' / 'invalid content' to the transient-error patterns recognised by _looks_like_rate_limit so that AzureOpenAIResponseClientWithRetry retries instead of failing. 2. Increase the ResultGenerator agent's max_tokens from 12_000 to 25_000 in OrchestratorBase to prevent truncation of large nested JSON schemas (the underlying cause of the 'invalid content' error). ADO #43771 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix(processor): retry 'model produced invalid content' and bump Resul…
Processor Coverage Report •
|
||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Syncs main (v2.0.4) into dev, forward-porting reliability improvements for Azure OpenAI retry behavior and structured result generation token budgeting in the processor orchestration layer.
Changes:
- Increases
ResultGeneratorresponsemax_tokensfrom 12,000 to 25,000 to reduce truncation risk for complex structured outputs. - Treats Azure OpenAI “model produced invalid content” responses as transient and eligible for retry in the Responses retry wrapper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/processor/src/libs/base/orchestrator_base.py |
Raises ResultGenerator max_tokens to reduce truncation during structured JSON generation. |
src/processor/src/libs/agent_framework/azure_openai_response_retry.py |
Expands transient-error detection to retry on “model produced invalid content”. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Roopan-Microsoft
approved these changes
May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
maintagv2.0.4(5a0efca) intodevso the two trunks stay in sync.model produced invalid contentandResultGenerator.max_tokensbump) intodev.devis otherwise 34 commits ahead ofmainon unrelated work; this PR only forward-ports the two commits below.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
dev:5a0efcaMerge pull request fix(processor): retry 'model produced invalid content' and bump Resul… #248 from microsoft/psl-sw/43771-design-fix-from-main3dfa183fix(processor): retry 'model produced invalid content' and bumpResultGeneratormax_tokens (Bug #43771)src/processorfor the Bug #43771 fix.chore/sync-main-into-dev-2026-05-20was created offorigin/main@5a0efca(tagv2.0.4) with no additional commits on top.Other Information
main:v2.0.4main->devsync; please use a merge commit (not squash) to preserve the original SHAs frommain.