Roo-Code/webview-ui/src/utils
Danger Mouse 571be71005
Pr 11144 (#11315)
* Latest main branch snapshot from API

* feat: add dedicated Azure OpenAI provider using @ai-sdk/azure package

* feat: add Azure provider UI component and translations

* feat: add Azure provider translations for all locales

* chore: add missing Azure placeholder translations

* Delete .changeset/azure-ai-sdk-migration.md

* fix: add Azure provider validation for onboarding workflow

- Add azureApiKey to SECRET_STATE_KEYS for proper configuration detection
- Add Azure validation case in validateModelsAndKeysProvided
- Add validation translations for azureResourceName and azureDeploymentName across all 18 locales

This fixes the issue where the Finish button does nothing when setting up Azure provider in the onboarding workflow.

* feat(azure): add model metadata, model picker, rename to Azure AI Foundry

- Add static model metadata for 29 Azure models (from models.dev)
  with Roo-specific flags (reasoning, tools, verbosity) matching
  openAiNativeModels
- Add model picker dropdown to Azure provider settings for model
  capability detection (context window, max tokens, pricing)
- Rename provider label from 'Azure OpenAI' to 'Azure AI Foundry'
  across all 18 locales
- Make API key optional (supports Azure managed identity / Entra ID)
- Update default API version from 2024-08-01-preview to 2025-04-01-preview
- Fix maxOutputTokens validation (filter invalid values <= 0)
- Handler separates deployment name (API calls) from model ID
  (capability lookup) with azureDefaultModelInfo (gpt-4o) fallback
- Remove unhelpful 'Get Azure AI Foundry Access' button
- Prevent stale model IDs from other providers carrying over
- Suppress validation errors on fresh provider selection

* fix(azure): add missing isAiSdkProvider() override for reasoning block preservation

* Azure Fixes for Hannes

* Quick Fix for Respones API Only (for Hannes)

* fix: use explicit azureOpenAiDefaultApiVersion fallback when apiVersion is empty

Addresses review feedback: the UI placeholder shows '2025-04-01-preview' via
azureOpenAiDefaultApiVersion, so the handler should use the same constant as
fallback instead of silently deferring to the SDK's internal default.

* fix: remove stale Cerebras references (retired provider)

* fix: add missing retiredProviderMessage translations for all locales

* fix: do not map promptCacheMissTokens to cacheWriteTokens for Azure

Azure uses OpenAI-compatible caching which does not report cache write
tokens separately. promptCacheMissTokens represents tokens NOT found in
cache (processed from scratch), not tokens written to cache. This aligns
the Azure handler with the OpenAI native handler behavior.

---------

Co-authored-by: Hannes Rudolph <hrudolph@gmail.com>
Co-authored-by: Roo Code <roomote@roocode.com>
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>
Co-authored-by: Matt Rubens <mrubens@users.noreply.github.com>
2026-02-09 14:11:12 -07:00
..
__tests__ refactor: remove 9 low-usage providers and add retired-provider UX (#11297) 2026-02-09 09:40:59 -07:00
batchConsecutive.ts feat: batch consecutive tool calls in chat UI with shared utility (#11245) 2026-02-09 11:28:04 -05:00
clipboard.ts fix(clipboard): Clear setTimeout in useCopyToClipboard to resolve memory leak (#4228) 2025-06-04 16:45:51 -04:00
command-parser.ts feat: Add terminal command permissions UI to chat interface (#5480) (#5798) 2025-07-25 16:49:51 -04:00
context-mentions.ts Move more types to @roo-code/types (for the cli) (#10583) 2026-01-09 11:59:06 -08:00
costFormatting.ts Feat/issue 5376 aggregate subtask costs (#10757) 2026-01-15 16:44:55 -05:00
docLinks.ts feat: add buildDocLink utility and 21 Internal Links to Docs (#3418) 2025-05-14 13:15:05 -04:00
format.ts Revert "feat: Experiment: Show a bit of stats in Cloud tab to help users discover there's more in Cloud" (#8559) 2025-10-07 21:37:10 -04:00
formatPathTooltip.ts refactor(read_file): Codex-inspired read_file refactor EXT-617 (#10981) 2026-01-29 15:16:32 -07:00
formatPrice.ts Better model picker 2025-02-07 12:25:52 -08:00
getLanguageFromPath.ts Refactor utilities to utils for consistency 2024-08-03 15:47:41 -04:00
highlight.ts fix: TaskItem display and copy issues with HTML tags in task messages. (#4444) 2025-06-11 23:50:56 -04:00
highlightDiff.ts feat(chat): Improve diff appearance in main chat view (#8932) 2025-11-06 16:18:01 -05:00
highlighter.ts Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
imageUtils.ts Message edit/delete overhaul (#5538) 2025-07-17 10:16:57 -04:00
markdown.ts feat: add button to open markdown in VSCode preview (#10773) 2026-01-16 10:56:19 -05:00
mcp.ts Move more types to @roo-code/types (for the cli) (#10583) 2026-01-09 11:59:06 -08:00
model-utils.ts Update the max-token calculation in model-params to use the shared logic (#5720) 2025-07-15 02:20:22 -04:00
parseUnifiedDiff.ts feat(chat): Improve diff appearance in main chat view (#8932) 2025-11-06 16:18:01 -05:00
path-mentions.ts Support mentioning filenames with spaces (#3044) 2025-04-29 22:27:16 -04:00
removeLeadingNonAlphanumeric.ts Show LLM streaming file write content (#3241) 2025-05-13 09:47:33 -07:00
sourceMapInitializer.ts debug: Add ErrorBoundary component for better error handling (#5085) 2025-07-23 08:45:35 -04:00
sourceMapUtils.ts debug: Add ErrorBoundary component for better error handling (#5085) 2025-07-23 08:45:35 -04:00
TelemetryClient.ts feat: migrate PostHog client to ph.roocode.com (#9402) 2025-11-19 14:44:22 -05:00
test-utils.tsx feat: Add provider routing selection for OpenRouter embeddings (#9144) (#9693) 2025-12-02 22:59:55 -05:00
textMateToHljs.ts Chore: Prettier for consistant formatting (#794) 2024-11-21 13:13:54 -08:00
url.ts Marketplace (#4538) 2025-06-11 17:28:12 -04:00
useDebounceEffect.ts Add support for Mermaid diagrams 2025-03-01 18:03:28 -05:00
validate.ts Pr 11144 (#11315) 2026-02-09 14:11:12 -07:00
vscode.ts chore: fix typos in comment & document (#5569) 2025-07-10 11:33:26 -04:00