-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Before submitting your bug report
- I've tried using the "Ask AI" feature on the Continue docs site to see if the docs have an answer
- I'm not able to find a related conversation on GitHub discussions that reports the same bug
- I'm not able to find an open issue that reports the same bug
- I've seen the troubleshooting guide on the Continue Docs
Relevant environment info
- OS: Windows 11 25H2
- Continue version: v1.2.11
- IDE: VS Code 1.107.11
- Model: Claude Sonnet 4.5 via Azure AI Foundry
- Target URI from Azure portal: `https://resource.services.ai.azure.com/anthropic/v1/messages`Description
Azure AI Foundry hosts multiple model providers (Anthropic, DeepSeek, Meta, etc.), each with their own API formats. Currently, Continue only supports Azure OpenAI Service format.
Problem 1: Wrong URL Construction
When using provider: azure with apiType: azure-foundry for Anthropic models (Claude), Continue generates:
https://resource.services.ai.azure.com/anthropic/v1/chat/completions?api-version=2023-07-01-preview
But Azure AI Foundry Anthropic endpoint should be:
https://resource.services.ai.azure.com/anthropic/v1/messages
Problem 2: Conversation Compacting Fails
Workaround of using provider: anthropic with Azure URL works for basic chat, but conversation compacting fails with:
messages.16: `tool_use` ids were found without `tool_result` blocks immediately after
Azure validates tool_use/tool_result message pairing more strictly than direct Anthropic API.
Proposed Solution
Modify Azure.ts to detect provider format based on model name:
protected getProviderFormat(): "openai" | "anthropic" {
const model = this.model.toLowerCase();
if (model.includes("claude")) {
return "anthropic";
}
if (model.includes("gpt") || model.includes("o1") || model.includes("o3")) {
return "openai";
}
return "openai"; // Default for backwards compatibility
}Then use the appropriate endpoint and message format for each provider.
To reproduce
- Configure Continue with:
- name: Claude Sonnet 4.5 (Azure)
provider: azure
model: claude-sonnet-4-5
apiBase: https://resource.services.ai.azure.com
apiKey: <your-api-key>
env:
apiType: azure-foundry-
Try to chat - generates wrong URL (
.../chat/completionsinstead of.../messages) -
Workaround by changing to
provider: anthropic- basic chat works -
Try to compact conversation - fails with tool_use/tool_result validation error
Log output
HTTP 400 Bad Request from https://resource.services.ai.azure.com/anthropic/v1/messages
{"type":"error","error":{"type":"invalid_request_error","message":"messages.16: `tool_use` ids were found without `tool_result` blocks immediately after: tooluse_XXX"}}Metadata
Metadata
Assignees
Labels
Type
Projects
Status