Python: Fix Anthropic option conflicts and manager parse retries#4000
Merged
eavanvalkenburg merged 3 commits intomicrosoft:mainfrom Feb 17, 2026
Merged
Python: Fix Anthropic option conflicts and manager parse retries#4000eavanvalkenburg merged 3 commits intomicrosoft:mainfrom
eavanvalkenburg merged 3 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Anthropic request option conflicts (notably allow_multiple_tool_calls and stream) and strengthens agent-based group chat manager parsing by adding bounded default retries and clearer retry guidance, with regression tests for the reported issues.
Changes:
- Filter unsupported/framework-level Anthropic options from prepared request payloads and keep
streamexplicit at SDK call sites. - Default agent-orchestrator retry attempts to a bounded value and provide stricter retry instructions for non-JSON/invalid outputs.
- Add regression tests covering non-JSON manager output retry/raise behavior and Anthropic option filtering/stream conflicts.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/packages/anthropic/agent_framework_anthropic/_chat_client.py | Drops allow_multiple_tool_calls and stream from forwarded Anthropic request kwargs to prevent SDK TypeError conflicts. |
| python/packages/anthropic/tests/test_anthropic_client.py | Adds/updates tests ensuring stream is excluded from run options and doesn’t conflict with explicit streaming mode; validates allow_multiple_tool_calls handling. |
| python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py | Sets a default retry budget for agent-based orchestration parsing and improves retry guidance (including participant name constraints). |
| python/packages/orchestrations/tests/test_group_chat.py | Adds tests for non-JSON manager output (retry then raise) and retry-then-recover behavior. |
python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py
Show resolved
Hide resolved
giles17
approved these changes
Feb 17, 2026
TaoChenOSU
reviewed
Feb 17, 2026
python/packages/orchestrations/agent_framework_orchestrations/_group_chat.py
Outdated
Show resolved
Hide resolved
- Strip unsupported Anthropic kwargs from prepared run options while preserving provider-specific mappings. - Keep stream mode explicit at Anthropic SDK call sites and prevent duplicate stream kwarg conflicts. - Add bounded default retries with strict retry prompt for agent-based group chat manager parse failures. - Add regression tests in anthropic and orchestrations packages covering microsoft#3371, microsoft#3827, and microsoft#3078. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add missing Any import in anthropic test module to fix ruff F821 failures in Package Checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revert orchestrations changes so this PR only contains Anthropic client fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a4c552e to
3208435
Compare
TaoChenOSU
approved these changes
Feb 17, 2026
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 17, 2026
* Python: Fix Anthropic kwargs and manager parse retries - Strip unsupported Anthropic kwargs from prepared run options while preserving provider-specific mappings. - Keep stream mode explicit at Anthropic SDK call sites and prevent duplicate stream kwarg conflicts. - Add bounded default retries with strict retry prompt for agent-based group chat manager parse failures. - Add regression tests in anthropic and orchestrations packages covering #3371, #3827, and #3078. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Python: Fix Anthropic test lint import Add missing Any import in anthropic test module to fix ruff F821 failures in Package Checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Python: Revert group chat changes from PR 4000 Revert orchestrations changes so this PR only contains Anthropic client fixes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
allow_multiple_tool_calls,stream) from prepared request payloadsstreamkwarg conflictsValidation
Fixes #3371
Fixes #3827