feat(agents): Add Azure AI Foundry credential support#12059
feat(agents): Add Azure AI Foundry credential support#12059lisanyambere wants to merge 3 commits intoopenclaw:mainfrom
Conversation
Additional Comments (2)
Prompt To Fix With AIThis is a comment left during a code review.
Path: src/agents/model-auth.ts
Line: 194:199
Comment:
**OAuth detection is wrong**
`resolveApiKeyForProvider` infers auth mode via `envResolved.source.includes("OAUTH_TOKEN")`, but `source` is prefixed with `"env: "` / `"shell env: "` and will never contain the substring `"OAUTH_TOKEN"` (it contains the full env var name like `ANTHROPIC_OAUTH_TOKEN`). This makes env-based OAuth always be reported as `"api-key"`, which can break downstream logic that relies on `mode` (e.g., selecting the right header/token behavior). Consider checking `envVar` (or `provider`/`normalized`) instead of `source`.
How can I resolve this? If you propose a fix, please make it concise.
Same issue in Prompt To Fix With AIThis is a comment left during a code review.
Path: src/agents/model-auth.ts
Line: 360:367
Comment:
**Env mode mis-detected**
Same issue in `resolveModelAuthMode`: it uses `envKey.source.includes("OAUTH_TOKEN")` to decide between `"oauth"` and `"api-key"`, but `source` never contains `"OAUTH_TOKEN"` as a standalone substring. With `ANTHROPIC_OAUTH_TOKEN` set, this will incorrectly return `"api-key"` rather than `"oauth"`.
How can I resolve this? If you propose a fix, please make it concise. |
|
Looks like duplicate of #6969 |
bfc1ccb to
f92900f
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
I think this is needed. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
##Summary
Adds support for Azure AI Foundry as a model provider, enabling OpenClaw to use models deployed on Azure's AI foundry resources
Changes
src/agents/model-auth.tsAZURE_AI_FOUNDRY_API_KEYwith fallback toAZURE_OPENAI_API_KEYTesting
Configuration Example
Users can configure Azure AI Foundry by setting: