fix(microsoft-foundry): filter Anthropic deployments during onboard#72446
fix(microsoft-foundry): filter Anthropic deployments during onboard#72446ottodeng wants to merge 5 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds a guardrail to the Confidence Score: 5/5Safe to merge — the change is self-contained, well-tested, and prevents a silent runtime failure without breaking existing functionality. Logic is sound: normalizeFoundryModelName lowercases before the startsWith('claude') check handles all case variants, null/undefined/empty are handled gracefully, and the filtering correctly uses modelName (the actual model) rather than the deployment name. Tests cover all relevant edge cases. No existing behavior is removed. No files require special attention. Reviews (1): Last reviewed commit: "fix(microsoft-foundry): filter Anthropic..." | Re-trigger Greptile |
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. for source-level reproduction: current main offers and persists all succeeded Foundry deployments while runtime/base URL construction only targets /openai/v1. I did not run a live Azure Foundry account. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Resolve the changelog markers, add redacted live Azure Foundry onboarding proof, then land the provider-local guardrail once exact-head checks are green. Do we have a high-confidence way to reproduce the issue? Yes for source-level reproduction: current main offers and persists all succeeded Foundry deployments while runtime/base URL construction only targets /openai/v1. I did not run a live Azure Foundry account. Is this the best way to solve the issue? Yes for the immediate bug once cleaned up: a provider-local guardrail is narrower than implementing full Anthropic Foundry support here, while #47181 remains the separate first-class Azure Claude onboarding effort. Full review comments:
Overall correctness: patch is incorrect What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against bc275573012b. |
d7fa841 to
4c0f392
Compare
|
Pushed updates addressing review feedback: [P2] Filter the persisted catalog too (dfa3a053da)
Tests (63efff4e4e)
[P3] CHANGELOG (16b750f12c)
Verification on tip
|
|
Merged latest |
6f9fbe9 to
28bfd52
Compare
|
Synced with upstream/main, CI green. Available for review. |
The built-in microsoft-foundry provider only supports OpenAI-compatible Foundry APIs (chat/completions, responses). Anthropic (Claude) deployments on Azure AI Foundry use a different API shape (/anthropic/v1/messages) that is not wired yet, causing silent 404 failures at runtime after apparently successful onboarding. Changes: - Add isAnthropicFoundryDeployment() to detect Claude model names - Filter Anthropic deployments from the selection list during onboard - Show an informative note with workaround (custom provider) when Anthropic deployments are skipped - Provide a specific error message when only Anthropic deployments exist - Add tests for the detection function Fixes openclaw#60546
…talog
Address PR review feedback: `selectFoundryDeployment` derived a local
`supported` list to drive the picker but the persistence path in
auth.ts still mapped the raw `resourceDeployments` into
`discoveredDeployments`, so mixed GPT+Claude resources hid Claude in
the picker yet still wrote it into the saved provider catalog as a
`microsoft-foundry/<deployment>` model that routes through /openai/v1.
- Add `partitionFoundryDeployments` in shared.ts as the single source
of truth for filtering.
- `selectFoundryDeployment` now returns `{ selected, supported }` so
callers can persist the same supported list the picker showed.
- `auth.ts` uses the supported list when building
`discoveredDeployments`, keeping the picker and catalog in sync.
…persistence Adds focused unit tests for the new partitionFoundryDeployments helper and the picker/persistence contract returned by selectFoundryDeployment: - mixed GPT+Claude resource: only GPT deployments persisted, Claude surfaced via the unsupported-deployment note - all-Anthropic resource: actionable error path - all-GPT resource: unchanged supported list with no warning note
28bfd52 to
ae6567b
Compare
|
Maintainer refresh: rebased onto current Prepared head: Local verification passed:
Waiting on fresh GitHub CI before merge. |
Summary
The built-in
microsoft-foundryprovider only supports OpenAI-compatible Foundry APIs (chat/completions,responses). However, Anthropic (Claude) deployments on Azure AI Foundry use a different API shape (/anthropic/v1/messages) that is not wired yet. This causes silent 404 failures at runtime after apparently successful onboarding — the user selects a Claude deployment, configuration looks correct, but requests fail.Changes
isAnthropicFoundryDeployment()to detect Claude model namesanthropic-messagesAPI) when Anthropic deployments are skippedWhy Option B (guardrail)
The issue suggests two approaches: full Anthropic API support (Option A) or a guardrail (Option B). This PR implements Option B because:
Testing
vitest run extensions/microsoft-foundry/index.test.ts)Fixes #60546