Repeated 413 errors on compaction

Resolved 💬 5 comments Opened Feb 11, 2026 by Plantain Closed Jun 29, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of the IDE extension are you using?

0.4.71

What subscription do you have?

Pro

Which IDE are you using?

VS Code

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Repeatedly get into this state after a while on the same task and unable to make progress - any subsequent message triggers a compaction. Resuming the chat results in the same.

Error running remote compact task: unexpected status 413 Payload Too Large: <html> <head><title>413 Payload Too Large</title></head> <body> <center><h1>413 Payload Too Large</h1></center> <hr><center>cloudflare</center> </body> </html>, url: https://chatgpt.com/backend-api/codex/responses/compact, cf-ray: 9cc3e53b69144874-BNE

Chatid 019c409c-983c-7dd2-b322-63d83b95de2c

What steps can reproduce the bug?

Long tasks with many compactions.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

tomzlabs · 6 months ago

Error running remote compact task: unexpected status 413 Payload Too Large: <html> <head><title>413 Payload Too Large</title></head> <body> <center><h1>413 Payload Too Large</h1></center> <hr><center>cloudflare</center> </body> </html>, url: https://chatgpt.com/backend-api/codex/responses/compact, cf-ray: 9d2276fa7aa45aac-MEL

nbarbettini · 6 months ago

I hit this with Codex CLI (not an IDE integration). Agent halted unexpectedly with 413 Payload Too Large, and any attempt to continue failed with 413. Compaction also failed with 413. thread ID 019c8df6-36df-79f3-99df-30d0e7fe6697

Code-Cats · 5 months ago

I’m also hitting this consistently in ChatGPT Codex.

Symptoms:

  • The conversation enters “auto compact / compress background” state.
  • Every subsequent message retriggers compaction.
  • Restarting the app or sending a new message in the same thread does not recover it.
  • The request fails with Cloudflare 413 on:

https://chatgpt.com/backend-api/codex/responses/compact

Observed error:
Error running remote compact task: unexpected status 413 Payload Too Large:
<html><head><title>413 Payload Too Large</title></head>
<body><center><h1>413 Payload Too Large</h1></center>
<hr><center>cloudflare</center></body></html>

cf-ray: 9db96b4fa9ef40fc-SIN

What makes this especially bad:

  • Once a thread gets into this state, it appears permanently stuck.
  • Even short follow-up messages fail because compaction is retried first.
  • The only workaround is starting a brand new conversation and manually summarizing context.

Expected behavior:

  • Compaction should chunk, trim, or otherwise bound payload size before sending.
  • If compaction fails, the thread should still remain usable instead of becoming unrecoverable.
  • Ideally the client should detect oversized compaction payloads and fall back to a smaller summary strategy automatically.

If useful, I can provide screenshots of the UI state showing “auto compressing background information” immediately before the 413.

Chi-Shan0707 · 2 months ago

I hit the same problem when trying to use Codex Cli to analyze some png files. When dealing with about less than 50 photos, it works. But it always failed if it tried to handle about 100 photos in a conversation.

etraut-openai contributor · 1 month 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.