Skip to content

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

Closed

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

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    azureIssues related to the Azure-hosted OpenAI models
    contextIssues related to context management (including compaction)
    on Apr 14, 2026
  2. added a commit that references this issue on Apr 15, 2026
    f2a4925
  3. added a commit that references this issue on May 7, 2026
    68683e3
  4. added a commit that references this issue on Jun 27, 2026
    e84d43b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions