Compact fails in CLI and Codex VS Code Extension

Resolved 💬 16 comments Opened Apr 22, 2026 by douglasware Closed Jun 29, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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???

View original on GitHub ↗

16 Comments

github-actions[bot] contributor · 2 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #18838
  • #18450
  • #17392
  • #17335
  • #17508

Powered by Codex Action

etraut-openai contributor · 2 months ago

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

douglasware · 2 months ago

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.

douglasware · 2 months ago
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.

douglasware · 2 months ago

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

etraut-openai contributor · 2 months ago

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.

infiloop2 · 2 months ago

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

dhruv2295 · 2 months ago

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"
douglasware · 2 months ago
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

dhruv2295 · 2 months ago

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
douglasware · 2 months ago
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://<resource>.openai.azure.com/openai/responses/v1 with curl the API works, but codex (for me) builds the URL using your example as https://<resource>.openai.azure.com/openai/v1/responses.

/shrug

apelsito · 2 months ago
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

douglasware · 2 months ago

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

apelsito · 2 months ago
@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

presidenzo · 2 months ago

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).

etraut-openai contributor · 21 days ago

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.