Skip to content

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

@ivanmurashko

Description

@ivanmurashko

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    azureIssues related to the Azure-hosted OpenAI modelsbugSomething isn't workingcontextIssues related to context management (including compaction)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions