Skip to content

Support remote compaction for Azure responses providers#17958

Merged
bolinfest merged 2 commits into
openai:mainfrom
ivanmurashko:fix/azure-remote-compaction
Apr 15, 2026
Merged

Support remote compaction for Azure responses providers#17958
bolinfest merged 2 commits into
openai:mainfrom
ivanmurashko:fix/azure-remote-compaction

Conversation

@ivanmurashko

@ivanmurashko ivanmurashko commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Azure Responses providers were still falling back to local compaction because the compaction gate only checked ModelProviderInfo::is_openai().

Move the capability check onto ModelProviderInfo with supports_remote_compaction(), backed by the existing Azure Responses endpoint detection used in codex-api, and have core::compact delegate to that helper.

Add regression coverage for:

  • OpenAI providers using remote compaction
  • Azure providers using remote compaction
  • non-OpenAI/non-Azure providers staying on the local path

resolves #17773

Comment thread codex-rs/model-provider-info/src/model_provider_info_tests.rs Outdated
bolinfest added a commit that referenced this pull request Apr 15, 2026
…ovider (#17965)

## Why

While reviewing #17958, the helper
name `is_azure_responses_wire_base_url` looked misleading because the
helper returns true for either the `azure` provider name or an Azure
Responses `base_url`. The new name makes both inputs part of the
contract.

## What

- Rename `is_azure_responses_wire_base_url` to
`is_azure_responses_provider`.
- Move the `openai.azure.` marker into
`matches_azure_responses_base_url` so all base URL marker matching is
centralized.
- Keep `Provider::is_azure_responses_endpoint()` behavior unchanged.

## Verification

- Compared the parent and current implementations.
`name.eq_ignore_ascii_case("azure")` still returns true before
consulting `base_url`, `None` still returns false, base URLs are still
lowercased before marker matching, and the same Azure marker set is
checked.
- Ran `cargo test -p codex-api`.
ivanmurashko and others added 2 commits April 15, 2026 19:45
Azure Responses providers were still falling back to local compaction because the compaction gate only checked `ModelProviderInfo::is_openai()`.

Move the capability check onto `ModelProviderInfo` with `supports_remote_compaction()`, backed by the existing Azure Responses endpoint detection used in `codex-api`, and have `core::compact` delegate to that helper.

Add regression coverage for:
- OpenAI providers using remote compaction
- Azure providers using remote compaction
- non-OpenAI/non-Azure providers staying on the local path
linter requirements

Co-authored-by: Michael Bolin <mbolin@openai.com>
@ivanmurashko ivanmurashko force-pushed the fix/azure-remote-compaction branch from b4c3db5 to b7a317d Compare April 15, 2026 19:29
@bolinfest bolinfest merged commit f2a4925 into openai:main Apr 15, 2026
9 of 25 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure provider silently uses local compaction instead of POST /responses/compact

2 participants