Files
windmill/frontend/src/lib/components/copilot/modelConfig.test.ts
T
hugocasaandClaude Opus 4.8 d600c7ecfe fix(ai): route Azure Foundry Claude models via Anthropic Messages API (#9908)
* fix(ai): route Azure Foundry Claude models via Anthropic Messages API

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(ai): keep explicit Azure OpenAI deployment base URLs intact

build_azure_openai_url only appends /openai/v1 for a bare resource root; any base with an explicit path (e.g. .../openai/deployments/<id>) is preserved. Adds a regression test and a unit test for usesAnthropicMessagesApi.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(ai): enable Claude extended thinking on Azure Foundry

Route azure_foundry+Claude through the Anthropic reasoning branch (adaptive thinking + output_config.effort) instead of the gpt/o gate, and recognize claude-sonnet-5. Live-verified: sonnet-5 and opus-4-8 on Foundry accept the low/medium/high/xhigh/max ladder and render summarized thinking.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 18:26:12 +02:00

24 lines
988 B
TypeScript

import { describe, expect, it } from 'vitest'
import { usesAnthropicMessagesApi } from './modelConfig'
describe('usesAnthropicMessagesApi', () => {
it('routes the native Anthropic provider through the Messages API', () => {
expect(usesAnthropicMessagesApi('anthropic', 'claude-sonnet-5')).toBe(true)
})
it('routes Azure Foundry Claude deployments through the Messages API', () => {
expect(usesAnthropicMessagesApi('azure_foundry', 'claude-sonnet-5')).toBe(true)
expect(usesAnthropicMessagesApi('azure_foundry', 'Claude-Opus-4-8')).toBe(true)
})
it('keeps other Azure Foundry models on the OpenAI-compatible path', () => {
expect(usesAnthropicMessagesApi('azure_foundry', 'gpt-4o')).toBe(false)
expect(usesAnthropicMessagesApi('azure_foundry', 'DeepSeek-R1')).toBe(false)
})
it('does not affect other providers', () => {
expect(usesAnthropicMessagesApi('openai', 'gpt-4o')).toBe(false)
expect(usesAnthropicMessagesApi('azure_openai', 'gpt-4o')).toBe(false)
})
})