Repository navigation
[Feat] Add custom deployment name support for native OpenAI - #2507
zoomote2[bot] wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
|
2 issues outstanding. See session
Reviewed a7cc162 |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Mark the PR ready. Required CI must pass before CodeRabbit starts. Review-state labels are managed by this workflow; do not edit them manually. |
| !!apiConfiguration.openAiNativeBaseUrl, | ||
| ) | ||
|
|
||
| const [openAiNativeDeploymentNameSelected, setOpenAiNativeDeploymentNameSelected] = useState( |
There was a problem hiding this comment.
When switching between two native OpenAI profiles, ApiOptions keeps this component mounted, so this initializer does not run again. Moving from a profile without a deployment name to one with a saved value leaves the checkbox unchecked and hides that value even though outbound requests will use it; the reverse leaves stale selected state too. Synchronize this state when apiConfiguration.openAiNativeDeploymentName changes, and add a rerender/profile-switch test.
| /> | ||
| </> | ||
| )} | ||
| <Checkbox |
There was a problem hiding this comment.
This adds user-visible settings UI, but the PR includes no *.visual.tsx snapshot or baseline. webview-ui/AGENTS.md requires one for user-visible layout changes and documents the pinned GitHub Actions fallback when Docker is unavailable. Please add focused visual coverage through that path.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
No linked issue. This change was requested directly as delegated work. It does not close an existing issue.
Description
Adds an optional custom deployment name to the native OpenAI provider. Gateways such as Azure AI Foundry address models by deployment name, not by catalog model id. Before this change, the native provider always sent the catalog model id in the Responses API request, and unknown ids fell back to the default model.
How it works:
openAiNativeDeploymentNamein the native OpenAI provider schema (packages/types).getModel()is unchanged.getOutboundModelId()resolves the wire value. The trimmed deployment name wins when it is set. A blank or unset value keeps the catalog model id.createMessage(SDK path and the manual SSE fallback, which reuses the same body) and non-streamingcompletePrompt.Test Procedure
Automated tests:
pnpm --dir src exec vitest run api/providers/__tests__/openai-native.spec.ts— 141 tests pass. New cases prove: the deployment name is sent asmodelon the SDK streaming path, on the SSE fallback path, and oncompletePrompt; catalog metadata and reasoning effort stay intact; unset, empty, and whitespace-only values keep the catalog model id.pnpm --dir src exec vitest run api/providers/__tests__/openai-native-usage.spec.ts api/providers/__tests__/openai-native-tools.spec.ts api/providers/__tests__/openai-terra-6.1.spec.ts api/providers/__tests__/openai-sol-6.1.spec.ts— 82 tests pass.pnpm --dir webview-ui exec vitest run src/components/settings/providers/__tests__/OpenAI.spec.tsx— 4 tests pass. New cases prove: the input stays hidden until the checkbox is checked, a typed value is persisted, and unchecking clears the saved value.pnpm --dir packages/types test— 642 tests pass.pnpm --dir src run check-types,pnpm --dir webview-ui run check-types,pnpm --dir packages/types run check-types— all pass.--prune-suppressions --max-warnings=0on the touched extension files, and--max-warnings=0on the touched webview files — clean, suppression counts unchanged.node scripts/find-missing-translations.js,node scripts/validate-plural-forms.js,node scripts/check-i18n-interpolation.js— all pass.pnpm testat the repo root — all 13 packages pass. Note: the first run showed 2 flaky failures insrc/__tests__/extension.spec.tsunder full-suite load. That spec passes standalone with and without this change, and passed on the full rerun. The failure is unrelated to this change.Manual check for reviewers:
model.Pre-Submission Checklist
src/test-utils/,@/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.*.visual.tsxsnapshot is included. Docker is unavailable in the authoring environment, and host-rendered baselines are not allowed. The new row reuses the existing checkbox and text-field pattern from the adjacent base URL setting. A maintainer can generate a baseline with the documented CI fallback if wanted.Visual Snapshots
None. See the "Visual Snapshot" checklist item above for the reason.
Videos (interaction / animation only)
None. The change adds a static settings row with no new interaction flow.
Documentation Updates
Additional Notes
The wire override is applied only to the request
modelfield. Cost calculation, context-window limits, service-tier validation, and reasoning-effort handling continue to use the selected catalog model.Get in Touch
Available via PR comments.