From 2e9c1c0d8274888cd9a78f16a1a987f024c0d84a Mon Sep 17 00:00:00 2001 From: Mason Cao Date: Wed, 16 Sep 2026 19:00:22 +0000 Subject: [PATCH 1/2] Let Codex route to Azure OpenAI Model Provider Services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex speaks the OpenAI dialect, which the gateway also fronts for azure_openai-backed MPSes, but the provider-type allowlist only listed `openai` — so launching Codex against an Azure OpenAI MPS was rejected ("codex can't route to (supported: openai)"). Add azure_openai to codex's allowed provider types. Co-authored-by: Isaac --- src/ucode/databricks.py | 10 ++++++---- tests/test_managed_setup.py | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ucode/databricks.py b/src/ucode/databricks.py index d9533340..857299fe 100644 --- a/src/ucode/databricks.py +++ b/src/ucode/databricks.py @@ -2024,12 +2024,14 @@ def build_skills_mcp_url(workspace: str, locations: list[str]) -> str: # Maps the gateway routing dialect a coding tool speaks to the Model Provider # Service `provider_type`s it can be backed by. claude speaks Anthropic's API, # which both the `anthropic` and `amazon_bedrock` provider types serve (Bedrock -# just exposes different model ids); codex speaks OpenAI's; gemini speaks -# Google's, served by a Gemini Enterprise provider. Tags are the short form -# produced by `_provider_type_tag` (e.g. `amazon_bedrock`). +# just exposes different model ids); codex speaks OpenAI's, which both the +# `openai` and `azure_openai` provider types serve (the gateway fronts Azure with +# the OpenAI surface); gemini speaks Google's, served by a Gemini Enterprise +# provider. Tags are the short form produced by `_provider_type_tag` (e.g. +# `amazon_bedrock`). _TOOL_PROVIDER_TYPES: dict[str, tuple[str, ...]] = { "claude": ("anthropic", "amazon_bedrock"), - "codex": ("openai",), + "codex": ("openai", "azure_openai"), "gemini": ("gemini_enterprise",), } diff --git a/tests/test_managed_setup.py b/tests/test_managed_setup.py index 76b38f5f..c54111af 100644 --- a/tests/test_managed_setup.py +++ b/tests/test_managed_setup.py @@ -361,8 +361,9 @@ def test_claude_supports_anthropic_and_bedrock(self): assert supports_provider_service("claude", "anthropic") assert supports_provider_service("claude", "amazon_bedrock") - def test_codex_supports_openai(self): + def test_codex_supports_openai_and_azure(self): assert supports_provider_service("codex", "openai") + assert supports_provider_service("codex", "azure_openai") def test_claude_does_not_support_openai(self): assert not supports_provider_service("claude", "openai") From b67a3c9eb21ddafbb4c23914f4d3fd796ba072d1 Mon Sep 17 00:00:00 2001 From: Mason Cao Date: Wed, 16 Sep 2026 19:04:37 +0000 Subject: [PATCH 2/2] Also let Codex route to Microsoft Foundry MPSes microsoft_foundry speaks the same OpenAI dialect as azure_openai, so add it to codex's provider-type allowlist alongside it. Co-authored-by: Isaac --- src/ucode/databricks.py | 12 ++++++------ tests/test_managed_setup.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ucode/databricks.py b/src/ucode/databricks.py index 857299fe..48f60033 100644 --- a/src/ucode/databricks.py +++ b/src/ucode/databricks.py @@ -2024,14 +2024,14 @@ def build_skills_mcp_url(workspace: str, locations: list[str]) -> str: # Maps the gateway routing dialect a coding tool speaks to the Model Provider # Service `provider_type`s it can be backed by. claude speaks Anthropic's API, # which both the `anthropic` and `amazon_bedrock` provider types serve (Bedrock -# just exposes different model ids); codex speaks OpenAI's, which both the -# `openai` and `azure_openai` provider types serve (the gateway fronts Azure with -# the OpenAI surface); gemini speaks Google's, served by a Gemini Enterprise -# provider. Tags are the short form produced by `_provider_type_tag` (e.g. -# `amazon_bedrock`). +# just exposes different model ids); codex speaks OpenAI's, which the `openai`, +# `azure_openai`, and `microsoft_foundry` provider types all serve (the gateway +# fronts Azure OpenAI and Foundry with the OpenAI surface); gemini speaks +# Google's, served by a Gemini Enterprise provider. Tags are the short form +# produced by `_provider_type_tag` (e.g. `amazon_bedrock`). _TOOL_PROVIDER_TYPES: dict[str, tuple[str, ...]] = { "claude": ("anthropic", "amazon_bedrock"), - "codex": ("openai", "azure_openai"), + "codex": ("openai", "azure_openai", "microsoft_foundry"), "gemini": ("gemini_enterprise",), } diff --git a/tests/test_managed_setup.py b/tests/test_managed_setup.py index c54111af..91d07b3b 100644 --- a/tests/test_managed_setup.py +++ b/tests/test_managed_setup.py @@ -361,9 +361,10 @@ def test_claude_supports_anthropic_and_bedrock(self): assert supports_provider_service("claude", "anthropic") assert supports_provider_service("claude", "amazon_bedrock") - def test_codex_supports_openai_and_azure(self): + def test_codex_supports_openai_azure_and_foundry(self): assert supports_provider_service("codex", "openai") assert supports_provider_service("codex", "azure_openai") + assert supports_provider_service("codex", "microsoft_foundry") def test_claude_does_not_support_openai(self): assert not supports_provider_service("claude", "openai")