Skip to content

Fix Azure Foundry Anthropic strict tools#4682

Open
roboomp wants to merge 1 commit into
mainfrom
farm/d5df12c6/sonnet-5-azure-foundry
Open

Fix Azure Foundry Anthropic strict tools#4682
roboomp wants to merge 1 commit into
mainfrom
farm/d5df12c6/sonnet-5-azure-foundry

Conversation

@roboomp

@roboomp roboomp commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Repro

Azure Foundry Anthropic Sonnet 5 utility requests fail with 400 structured_outputs not supported in your workspace because the route receives Anthropic strict-tool structured-output framing. Reproduced with bun test packages/ai/test/issue-4679-repro.test.ts before the fix: Azure Foundry Anthropic compat resolved disableStrictTools as false.

Cause

packages/catalog/src/compat/anthropic.ts recognized Azure AI Inference / Foundry Anthropic URLs as signing endpoints but still set ResolvedAnthropicCompat.disableStrictTools to false. packages/ai/src/providers/anthropic.ts then built OAuth utility headers through buildClaudeCodeBetas without considering strict-tool disablement, so structured-outputs-2025-12-15 remained in anthropic-beta even when strict tools were intended to be removed.

Fix

  • Detect Azure AI Inference / Foundry Anthropic routes as strict-tool-incompatible in buildAnthropicCompat.
  • Thread disableStrictTools into Anthropic client option/header construction.
  • Omit structured-outputs-2025-12-15 from Claude Code OAuth beta defaults when strict tools are disabled.
  • Add regression coverage for both Azure Foundry host shapes, direct Anthropic beta retention, and strict tool-schema omission.

Verification

Focused tests passed: bun test packages/ai/test/issue-4679-repro.test.ts (4 pass, 10 assertions), bun test packages/ai/test/issue-826-repro.test.ts (4 pass, 7 assertions), and bun test packages/catalog/test/issue-4297-repro.test.ts (10 pass, 22 assertions). gh_push_branch also completed its pre-publish gate and pushed farm/d5df12c6/sonnet-5-azure-foundry. Fixes #4679

Azure Foundry Anthropic routes reject Anthropic structured-output strict tooling for Sonnet 5 utility requests.

Detect Azure Anthropic hosts as strict-tool-incompatible, gate the structured-output beta when strict tools are disabled, and cover the utility header plus tool-schema contracts.

Fixes #4679
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions github-actions Bot added the vouched Passed the vouch gate label Jul 6, 2026
@roboomp

roboomp commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

No code change requested by the Codex quota notice. PR #4682 remains ready for maintainer review; repo admins need to enable Codex review credits if they want the automated review to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sonnet 5 Azure foundry not working

1 participant