Skip to content

Compact fails in CLI and Codex VS Code Extension #19009

Closed

Description

@douglasware

What version of Codex CLI is running?

codex-cli 0.122.0

What subscription do you have?

Using Azure Foundry

Which model were you using?

gpt-5.3-codex, gpt-5.4

What platform is your computer?

Windows 11

What terminal emulator and version are you using (if applicable)?

VSCode, Windows Terminal

What issue are you seeing?

Yesterday this began appearing. When a chat gets to the compaction it fails 100% of the time and cannot be continued.

Error running remote compact task: We're currently experiencing high demand, which may cause temporary errors.

What steps can reproduce the bug?

Use Azure Foundry deployment.
Attempt manual compaction or hit the auto-compact threshold.

What is the expected behavior?

Be usable for long conversations without fatal conversation blocking failures.

Additional information

Chat works fine. Whatever this "remote" job is? Is not.
We presume it is in fact a data exfiltration and privacy issue. Why are you sending my conversation to some remote service that isn't using my deployments???

Activity

  1. added
    CLIIssues related to the Codex CLI
    azureIssues related to the Azure-hosted OpenAI models
    contextIssues related to context management (including compaction)
    on Apr 22, 2026
  2. etraut-openai commented on Apr 22, 2026

    @etraut-openai
    Contributor

    Please report the problem to the Azure folks. Based on the error message, it sounds like they have capacity issues.

  3. douglasware commented on Apr 22, 2026

    @douglasware
    Author

    They do not. It isn't sending it to my subscription, I can see the network traffic and there are literally 0 problems with the many other systems burning millions of tokens per hour in our tenant, just Codex.

  4. douglasware commented on Apr 22, 2026

    @douglasware
    Author

    Please report the problem to the Azure folks. Based on the error message, it sounds like they have capacity issues.

    Please re-add the tag and fix your defects.

  5. douglasware commented on Apr 22, 2026

    @douglasware
    Author

    Also, that reply was super helpful and is going in our slide-deck as we lobby for less spend on OpenAI models and more on Anthropic. Thanks for your support! <3

  6. etraut-openai commented on Apr 22, 2026

    @etraut-openai
    Contributor

    Compaction is done by a separate remote compaction endpoint. Azure just recently implemented this endpoint, which might explain why you just started to see this problem a few days ago. Prior to that, the Codex harness feel back to local compaction for Azure users, which is suboptimal.

    Based on the error you're seeing, it sounds like there's an issue with Azure's compaction endpoint. It's possible that they have plenty of capacity allocated for the primary "responses" endpoint but not for the compaction endpoint. It's important to report the issue to them so they know that they may need to make server-side capacity adjustments to address this issue.

  7. infiloop2 commented on Apr 22, 2026

    @infiloop2

    i am using chatgpt subscription and facing this issue in cli as well as vscode extension

  8. dhruv2295 commented on Apr 23, 2026

    @dhruv2295

    I was facing the same issue. updating azure url to v1 in config, and removing api_version did the trick for me.

    - base_url = "https://<resource>.openai.azure.com/openai/"
    +base_url = "https://<resource>.openai.azure.com/openai/v1"
    
    
    - [model_providers.azure.query_params]
    - api-version = "2025-04-01-preview"
    
  9. douglasware commented on Apr 23, 2026

    @douglasware
    Author

    I was facing the same issue. updating azure url to v1 in config, and removing api_version did the trick for me.

    - base_url = "https://<resource>.openai.azure.com/openai/"
    +base_url = "https://<resource>.openai.azure.com/openai/v1"
    
    - [model_providers.azure.query_params]
    - api-version = "2025-04-01-preview"
    

    Adding /v1 causes {"error":{"code":"BadRequest","message":"API version not supported"}} for me. codex-cli 0.123.0

  10. dhruv2295 commented on Apr 23, 2026

    @dhruv2295

    weird. works just fine for me.
    here's the exact azure config I am using.

    model = "gpt-5.4"
    model_provider = "azure"
    model_reasoning_effort = "high"
    
    [model_providers.azure]
    base_url = "https://<resource>.openai.azure.com/openai/v1"
    env_key = "AZURE_OPENAI_API_KEY"
    name = "Azure"
    wire_api = "responses"
    

    I'm on 0.123 as well. remember to remove api-version also if it exists

    I was facing the same issue. updating azure url to v1 in config, and removing api_version did the trick for me.

    - base_url = "https://<resource>.openai.azure.com/openai/"
    +base_url = "https://<resource>.openai.azure.com/openai/v1"
    
    - [model_providers.azure.query_params]
    - api-version = "2025-04-01-preview"
    

    Adding /v1 causes {"error":{"code":"BadRequest","message":"API version not supported"}} for me. codex-cli 0.123.0

  11. douglasware commented on Apr 23, 2026

    @douglasware
    Author

    weird. works just fine for me. here's the exact azure config I am using.

    model = "gpt-5.4"
    model_provider = "azure"
    model_reasoning_effort = "high"
    
    [model_providers.azure]
    base_url = "https://<resource>.openai.azure.com/openai/v1"
    env_key = "AZURE_OPENAI_API_KEY"
    name = "Azure"
    wire_api = "responses"
    

    I'm on 0.123 as well. remember to remove api-version also if it exists

    I was facing the same issue. updating azure url to v1 in config, and removing api_version did the trick for me.

    - base_url = "https://<resource>.openai.azure.com/openai/"
    +base_url = "https://<resource>.openai.azure.com/openai/v1"
    
    - [model_providers.azure.query_params]
    - api-version = "2025-04-01-preview"
    

    Adding /v1 causes {"error":{"code":"BadRequest","message":"API version not supported"}} for me. codex-cli 0.123.0

    If I hit https://.openai.azure.com/openai/responses/v1 with curl the API works, but codex (for me) builds the URL using your example as https://.openai.azure.com/openai/v1/responses.

    /shrug

  12. apelsito commented on Apr 24, 2026

    @apelsito

    weird. works just fine for me. here's the exact azure config I am using.

    model = "gpt-5.4"
    model_provider = "azure"
    model_reasoning_effort = "high"
    
    [model_providers.azure]
    base_url = "https://<resource>.openai.azure.com/openai/v1"
    env_key = "AZURE_OPENAI_API_KEY"
    name = "Azure"
    wire_api = "responses"
    

    I'm on 0.123 as well. remember to remove api-version also if it exists

    I was facing the same issue. updating azure url to v1 in config, and removing api_version did the trick for me.

    My man, you had a helpful answer instead of pointing the finger and saying (It's another one fault), honestly , you have a product that people use, they have been reporting this issue for weeks now and i was not able to find a workaround from no one.

    Microsoft will say its OpenAI's fault and OpenAI says its Azure's fault, not my problem but yours if you are claiming Azure OpenAI works in Codex. (Dont feel offended, it's just my opinion!)

    Anyways thank you @dhruv2295 you actually saved me time and headaches

  13. douglasware commented on Apr 24, 2026

    @douglasware
    Author

    @dhruv2295 and @apelsito thanks for the posts. I was being stupid and failed to remove the api-version after adding /v1.

  14. apelsito commented on Apr 24, 2026

    @apelsito

    @dhruv2295 and @apelsito thanks for the posts. I was being stupid and failed to remove the api-version after adding /v1.

    The man to thank is @dhruv2295 !! But i'm glad it worked out for you too! Cheers @douglasware

  15. presidenzo commented on May 7, 2026

    @presidenzo

    Also seeing this on Codex Desktop for macOS.

    Thread ID: 019e0390-d329-74c3-b8ab-13a32d339c9b
    Codex App: 26.429.61741 (2429)
    Error:

    Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
    

    This is still happening today (2026-05-07).

  16. etraut-openai commented on Jun 29, 2026

    @etraut-openai
    Contributor

    Thanks for reporting this problem. Until recently, Codex used a separate endpoint and server-side logic for compaction. We recently switched to a more robust approach where the compaction logic is moved locally using the same endpoint as normal turns. This eliminates "remote compaction" errors and increases the stability and reliability of compaction operations. If you see further problems with compaction, please use /feedback and open a new bug report.

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