Problem
When using an Azure OpenAI provider (name = "Azure" or an Azure base URL), Codex silently falls back to local model-generated compaction instead of calling POST /responses/compact, even though Azure's Responses API fully supports it. No error or warning is shown.
Root Cause
The compaction routing gate in core/src/compact.rs checks only is_openai():
pub(crate) fn should_use_remote_compact_task(provider: &ModelProviderInfo) -> bool {
provider.is_openai() // true only when name == "OpenAI" (exact, case-sensitive)
}
The standard Azure configuration requires name = "Azure" to activate attach_item_ids via is_azure_responses_endpoint() (case-insensitive check in codex-api/src/provider.rs). But that same name makes is_openai() return false, silently disabling remote compaction. The two checks are mutually exclusive — no single name value satisfies both.
name |
is_openai() |
is_azure_responses_endpoint() |
Result |
"OpenAI" |
✓ |
✗ |
Remote compaction on, attach_item_ids off (breaks Azure) |
"Azure" |
✗ |
✓ |
Remote compaction off, attach_item_ids on |
Problem
When using an Azure OpenAI provider (
name = "Azure"or an Azure base URL), Codex silently falls back to local model-generated compaction instead of callingPOST /responses/compact, even though Azure's Responses API fully supports it. No error or warning is shown.Root Cause
The compaction routing gate in
core/src/compact.rschecks onlyis_openai():The standard Azure configuration requires
name = "Azure"to activateattach_item_idsviais_azure_responses_endpoint()(case-insensitive check incodex-api/src/provider.rs). But that same name makesis_openai()returnfalse, silently disabling remote compaction. The two checks are mutually exclusive — no singlenamevalue satisfies both.nameis_openai()is_azure_responses_endpoint()"OpenAI"attach_item_idsoff (breaks Azure)"Azure"attach_item_idson