Skip to content

Python: Fix Anthropic option conflicts and manager parse retries#4000

Merged
eavanvalkenburg merged 3 commits intomicrosoft:mainfrom
eavanvalkenburg:anthropic-fixes
Feb 17, 2026
Merged

Python: Fix Anthropic option conflicts and manager parse retries#4000
eavanvalkenburg merged 3 commits intomicrosoft:mainfrom
eavanvalkenburg:anthropic-fixes

Conversation

@eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Feb 17, 2026

Summary

Validation

  • uv run pytest packages/anthropic/tests/test_anthropic_client.py packages/orchestrations/tests/test_group_chat.py -q

Fixes #3371
Fixes #3827

Copilot AI review requested due to automatic review settings February 17, 2026 16:28
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 17, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/anthropic/agent_framework_anthropic
   _chat_client.py36814859%422, 451, 483, 485, 504, 526–529, 538, 540, 577–581, 583, 585–586, 588, 593–594, 596, 629–630, 639, 641–642, 647, 664–665, 709, 728, 743, 745, 749–750, 793–795, 797, 810–811, 818–820, 824–826, 830–833, 844, 846, 868, 878, 900–906, 913–914, 922–923, 931–934, 941–942, 948–949, 955–956, 962, 970–972, 976, 983–984, 990–991, 997–998, 1004, 1012–1015, 1022–1023, 1042, 1049–1050, 1069, 1091, 1093, 1102–1103, 1109, 1131–1132, 1138–1139, 1148–1158, 1165–1171, 1178–1184, 1191–1200, 1207–1210
TOTAL20602323184% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3960 225 💤 0 ❌ 0 🔥 1m 10s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 stream explicit 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.

eavanvalkenburg and others added 3 commits February 17, 2026 20:22
- 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>
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue 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>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 17, 2026
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 17, 2026
Merged via the queue into microsoft:main with commit 794f84c Feb 17, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

4 participants