Skip to content

[Feat] Add custom deployment name support for native OpenAI - #2507

Draft
zoomote2[bot] wants to merge 1 commit into
mainfrom
feature/openai-native-deployment-name-3g763viu7l116
Draft

zoomote2[bot] wants to merge 1 commit into
mainfrom
feature/openai-native-deployment-name-3g763viu7l116

Conversation

@zoomote2

@zoomote2 zoomote2 Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @taltas. View the session or mention @roomote for follow-up asks.

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:

  • New optional setting openAiNativeDeploymentName in the native OpenAI provider schema (packages/types).
  • The selected catalog model still drives capabilities, reasoning behavior, pricing, and telemetry. getModel() is unchanged.
  • A new getOutboundModelId() resolves the wire value. The trimmed deployment name wins when it is set. A blank or unset value keeps the catalog model id.
  • Both outbound request paths use it: streaming createMessage (SDK path and the manual SSE fallback, which reuses the same body) and non-streaming completePrompt.
  • The native OpenAI settings UI has a new "Use custom deployment name" checkbox with a text field. It mirrors the existing "Use custom base URL" pattern and uses VS Code toolkit components.
  • New labels and descriptions are translated in all 18 locales.
  • This change is independent of the OpenAI Compatible provider.

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 as model on the SDK streaming path, on the SSE fallback path, and on completePrompt; 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.
  • ESLint with --prune-suppressions --max-warnings=0 on the touched extension files, and --max-warnings=0 on 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.
  • Full pnpm test at the repo root — all 13 packages pass. Note: the first run showed 2 flaky failures in src/__tests__/extension.spec.ts under 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:

  1. Open Settings and select the OpenAI (native) provider.
  2. Check "Use custom deployment name" and enter a deployment name.
  3. Save and start a task against a gateway that expects a deployment name. The request sends the deployment name as model.

Pre-Submission Checklist

  • Issue Linked: No approved tracking issue exists; this PR delivers directly requested delegated work.
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Test Helpers (test changes only): Shared test helpers (src/test-utils/, @/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.
  • Visual Snapshot (UI changes only): No *.visual.tsx snapshot 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.
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

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

  • No documentation updates are required. (Requester explicitly scoped this change to the extension repository only.)

Additional Notes

The wire override is applied only to the request model field. 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.

@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1

  • coderabbit-review-active

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zoomote2

zoomote2 Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

2 issues outstanding. See session

  • webview-ui/src/components/settings/providers/OpenAI.tsx:27 — Synchronize the deployment-name checkbox when the profile configuration changes.
  • webview-ui/src/components/settings/providers/OpenAI.tsx:66 — Add the required visual snapshot and baseline for the new settings UI.

Reviewed a7cc162

@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Review status

This 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. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

!!apiConfiguration.openAiNativeBaseUrl,
)

const [openAiNativeDeploymentNameSelected, setOpenAiNativeDeploymentNameSelected] = useState(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

codecov Bot commented Nov 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant