Skip to content

Let Codex route to Azure OpenAI and Microsoft Foundry Model Provider Services - #685

Merged
masonc08 merged 3 commits into
mainfrom
masonc08/codex-azure-openai
Sep 18, 2026
Merged

masonc08 merged 3 commits into
mainfrom
masonc08/codex-azure-openai

Conversation

@masonc08

@masonc08 masonc08 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

What did you change, and why?

Change: Add azure_openai and microsoft_foundry to Codex's allowed provider types (_TOOL_PROVIDER_TYPES).
Why: Codex speaks the OpenAI dialect, and the AI Gateway fronts azure_openai- and microsoft_foundry-backed Model Provider Services with that same OpenAI surface — but the allowlist only listed openai, so pointing Codex at one (via --provider or a managed config) failed with "codex can't route to (supported: openai)". This permits both.

How do you know it works?

Screen.Recording.2026-09-17.at.14.27.01.mov
Screen.Recording.2026-09-17.at.14.55.59.mov

Testing: Extended the provider-support unit test to assert Codex accepts azure_openai and microsoft_foundry; test_managed_setup.py + test_databricks.py pass (369 tests). End-to-end routing against live Azure OpenAI / Foundry MPSes is being validated separately.

This pull request and its description were written by Isaac.

@masonc08 masonc08 changed the title Let Codex route to Azure OpenAI Model Provider Services Let Codex route to Azure OpenAI and Microsoft Foundry Model Provider Services Sep 16, 2026
@lilly-luo

Copy link
Copy Markdown
Collaborator

can you show an e2e of codex talking to an azure open ai + foundry mps? ideally video

@masonc08
masonc08 force-pushed the masonc08/codex-azure-openai branch 2 times, most recently from 46fb7fb to caaf241 Compare September 17, 2026 15:49
masonc08 added a commit that referenced this pull request Sep 17, 2026
Cover routing Codex through an azure_openai Model Provider Service, backed by
main.ucode.ci_azure_openai_mps (allowlist: gpt-5-nano, gpt-5.6-luna reasoning;
gpt-4.1-mini non-reasoning).

- e2e TestAzureOpenAiMps: direct Responses-API probes through the gateway MPS
  (no agent binary; gateway shard, independent of #685) — reasoning-capable
  models route and are switchable, a non-reasoning allow-listed model rejects
  reasoning.effort (parity: what fails natively fails here), the same model
  serves without reasoning, and an off-allowlist model is refused.
- integration test_ug_configure_codex_azure_openai_mps: the real ug CLI picks
  the Azure MPS in the configure picker and completes a file task on gpt-5-nano.
  Requires #685 (adds azure_openai to Codex's provider-type allowlist).
- run_integration.py / conftest.py: --codex-azure-provider(-model) plumbing.

Co-authored-by: Isaac <no-reply@databricks.com>
@masonc08
masonc08 enabled auto-merge (squash) September 17, 2026 18:57
masonc08 and others added 2 commits September 18, 2026 14:29
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 <no-reply@databricks.com>
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 <no-reply@databricks.com>
@masonc08
masonc08 force-pushed the masonc08/codex-azure-openai branch from cd9ec9d to b67a3c9 Compare September 18, 2026 14:30
masonc08 added a commit that referenced this pull request Sep 18, 2026
Cover routing Codex through an azure_openai Model Provider Service, backed by
main.ucode.ci_azure_openai_mps (allowlist: gpt-5-nano, gpt-5.6-luna reasoning;
gpt-4.1-mini non-reasoning).

- e2e TestAzureOpenAiMps: direct Responses-API probes through the gateway MPS
  (no agent binary; gateway shard, independent of #685) — reasoning-capable
  models route and are switchable, a non-reasoning allow-listed model rejects
  reasoning.effort (parity: what fails natively fails here), the same model
  serves without reasoning, and an off-allowlist model is refused.
- integration test_ug_configure_codex_azure_openai_mps: the real ug CLI picks
  the Azure MPS in the configure picker and completes a file task on gpt-5-nano.
  Requires #685 (adds azure_openai to Codex's provider-type allowlist).
- run_integration.py / conftest.py: --codex-azure-provider(-model) plumbing.

Co-authored-by: Isaac <no-reply@databricks.com>
masonc08 added a commit that referenced this pull request Sep 18, 2026
Foundry speaks the same OpenAI dialect as Azure OpenAI, so extract the
configure-picker + launch CUJ into a shared helper and add a thin
test_ug_configure_codex_foundry_mps wrapper reusing it. Mirror the Azure
flags/fixtures as --codex-foundry-provider / --codex-foundry-provider-model.

Requires #685 (adds microsoft_foundry to Codex's allowlist) and a CI Foundry MPS.

Co-authored-by: Isaac <no-reply@databricks.com>
@masonc08
masonc08 merged commit 2255863 into main Sep 18, 2026
20 checks passed
@masonc08
masonc08 deleted the masonc08/codex-azure-openai branch September 18, 2026 16:27
masonc08 added a commit that referenced this pull request Sep 18, 2026
Cover routing Codex through an azure_openai Model Provider Service, backed by
main.ucode.ci_azure_openai_mps (allowlist: gpt-5-nano, gpt-5.6-luna reasoning;
gpt-4.1-mini non-reasoning).

- e2e TestAzureOpenAiMps: direct Responses-API probes through the gateway MPS
  (no agent binary; gateway shard, independent of #685) — reasoning-capable
  models route and are switchable, a non-reasoning allow-listed model rejects
  reasoning.effort (parity: what fails natively fails here), the same model
  serves without reasoning, and an off-allowlist model is refused.
- integration test_ug_configure_codex_azure_openai_mps: the real ug CLI picks
  the Azure MPS in the configure picker and completes a file task on gpt-5-nano.
  Requires #685 (adds azure_openai to Codex's provider-type allowlist).
- run_integration.py / conftest.py: --codex-azure-provider(-model) plumbing.

Co-authored-by: Isaac <no-reply@databricks.com>
masonc08 added a commit that referenced this pull request Sep 18, 2026
Foundry speaks the same OpenAI dialect as Azure OpenAI, so extract the
configure-picker + launch CUJ into a shared helper and add a thin
test_ug_configure_codex_foundry_mps wrapper reusing it. Mirror the Azure
flags/fixtures as --codex-foundry-provider / --codex-foundry-provider-model.

Requires #685 (adds microsoft_foundry to Codex's allowlist) and a CI Foundry MPS.

Co-authored-by: Isaac <no-reply@databricks.com>
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.

3 participants