feat(models): Adding support for claude/anthropic models on Azure Foundry - #2424
Open
marosset wants to merge 1 commit into
Open
feat(models): Adding support for claude/anthropic models on Azure Foundry#2424marosset wants to merge 1 commit into
marosset wants to merge 1 commit into
Conversation
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
marosset
requested review from
a team,
Charlesthebird,
peterj and
supreme-gg-gg
as code owners
August 11, 2026 18:42
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds Azure AI Foundry support for Claude/Anthropic chat models by introducing an apiFormat discriminator and wiring it through CRDs, translation layers, runtime dispatch, tracing, and new Anthropic client support.
Changes:
- Add
spec.foundry.apiFormat(OpenAI default vs Anthropic) to CRD/UI types and propagate it through the Go controller → ADK translation. - Implement Foundry Anthropic (Messages API) client construction + implicit auth (API key or Entra token) and route Foundry models accordingly at runtime.
- Extend supported model listings, tracing provider attribution, and add unit/e2e tests for the Anthropic format path.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/types/index.ts | Adds apiFormat to Foundry config typing for UI clients. |
| helm/kagent-crds/templates/kagent.dev_modelconfigs.yaml | Updates Helm CRD schema with apiFormat enum/default and clarifies apiVersion behavior. |
| go/core/test/e2e/foundry_test.go | Adds e2e coverage for Foundry Anthropic chat round-trip using a mock Messages endpoint. |
| go/core/internal/httpserver/handlers/models.go | Lists Claude models as supported and documents apiFormat=Anthropic. |
| go/core/internal/controller/translator/agent/foundry_test.go | Adds unit test ensuring Foundry Anthropic format is translated correctly; asserts OpenAI default. |
| go/core/internal/controller/translator/agent/adk_api_translator.go | Maps CRD APIFormat to ADK wire field on Foundry models. |
| go/core/internal/a2a/trace_test.go | Adds tests for provider-name resolution including Foundry Anthropic vs OpenAI format. |
| go/core/internal/a2a/trace.go | Switches resolver to client.Reader and attributes Foundry Anthropic spans to anthropic; adds Foundry provider mapping. |
| go/api/v1alpha2/modelconfig_types.go | Introduces FoundryAPIFormat type and adds apiFormat to FoundryConfig with defaults/enum. |
| go/api/config/crd/bases/kagent.dev_modelconfigs.yaml | Updates generated CRD base with apiFormat and apiVersion docs. |
| go/api/adk/types.go | Adds api_format field to ADK Foundry model plus string constants. |
| go/adk/pkg/models/foundry_test.go | Adds comprehensive unit tests for Foundry Anthropic client auth paths and passthrough behavior. |
| go/adk/pkg/models/foundry.go | Implements NewFoundryAnthropicModelWithLogger and updates Foundry docs/dispatch assumptions. |
| go/adk/pkg/internal/azureai/azureai_test.go | Expands tests for scoped token acquisition, implicit auth resolver, and new Anthropic client. |
| go/adk/pkg/internal/azureai/azureai.go | Adds scope selection, shared implicit auth resolver, and Foundry Anthropic client construction. |
| go/adk/pkg/agent/agent.go | Routes Foundry models with apiFormat=anthropic to an Anthropic model implementation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+193
to
+199
| _, _ = client.Messages.New(context.Background(), anthropic.MessageNewParams{ | ||
| Model: anthropic.Model("dep"), | ||
| MaxTokens: 16, | ||
| Messages: []anthropic.MessageParam{ | ||
| anthropic.NewUserMessage(anthropic.NewTextBlock("hi")), | ||
| }, | ||
| }) |
Comment on lines
+228
to
+234
| _, _ = client.Messages.New(context.Background(), anthropic.MessageNewParams{ | ||
| Model: anthropic.Model("dep"), | ||
| MaxTokens: 16, | ||
| Messages: []anthropic.MessageParam{ | ||
| anthropic.NewUserMessage(anthropic.NewTextBlock("hi")), | ||
| }, | ||
| }) |
Comment on lines
+378
to
+382
| cfg := &models.AnthropicConfig{ | ||
| TransportConfig: transportConfigFromBase(m.BaseModel, nil), | ||
| Model: m.Model, | ||
| } | ||
| return models.NewFoundryAnthropicModelWithLogger(ctx, cfg, m.Endpoint, m.Deployment, nil, log) |
Comment on lines
+126
to
+131
| if ep == "" { | ||
| return nil, fmt.Errorf("FOUNDRY_ENDPOINT environment variable is not set") | ||
| } | ||
| if dep == "" { | ||
| return nil, fmt.Errorf("FOUNDRY_DEPLOYMENT environment variable is not set") | ||
| } |
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.
Follow up to #2091
Adding support for configuring Anthropic chat models on Azure Foundry.
These changes re-use the same Azure authentication logic and workflows that was implemented in 2091
These changes are currently go only (just like the previous work on Foundry).
I will follow up with python support for Azure Foundry models in the future.