codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

Open swoiow opened this issue 10 months ago • 43 comments

What version of Codex is running?

v0.80.0

What subscription do you have?

i just at the begining of the chat, with one question.

Which model were you using?

other

What platform is your computer?

win-x64

What issue are you seeing?

Image

What steps can reproduce the bug?

Uploaded thread: 019bab9f-b98b-7113-9fa8-f439369b7233

现在的lua新增路由的时候,是会处理upstream下面所有的路由吗?譬如```--- 1. 更新路由: xx/v1/sync/ ---
  路由结果: {'target': 'http://xx:8000', 'host': 'xx', 'status': 'ok'}``` 访问xx/v1/sync/
  business 是不是相当于访问http://xx:8000/business

What is the expected behavior?

No response

Additional information

💡 Tip: If someone reports the same issue, please use the /feedback slash command to upload your logs. 📝

swoiow avatar Jan 11 '26 06:01 swoiow

Please use the /feedback slash command to upload your logs and session details for this session, then post the thread ID here.

Edit: Apologies, I just noticed that you included a thread ID. I missed it because of the formatting.

etraut-openai avatar Jan 11 '26 06:01 etraut-openai

Please use the /feedback slash command to upload your logs and session details for this session, then post the thread ID here.

Edit: Apologies, I just noticed that you included a thread ID. I missed it because of the formatting.

yes, please ,see this -> Uploaded thread: 019bab9f-b98b-7113-9fa8-f439369b7233 @etraut-openai Ok, that is fine. i have the same feeling too. the format is control by your template.

swoiow avatar Jan 11 '26 07:01 swoiow

even with the latest release ((v0.98.0), I am getting the same error repeatedly and quite often

■ Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

sriinnu avatar Feb 06 '26 10:02 sriinnu

even with the latest release ((v0.98.0), I am getting the same error repeatedly and quite often

■ Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

I just downgraded and pinned my version to v0.80.0 (haha). It has fewer latest skills but works with other models. When I start a new conversation, I don't get the 'Codex ran out of room' warning. @sriinnu

swoiow avatar Feb 06 '26 19:02 swoiow

Also had some issues around this. In my case, it seems to be the remote compaction feature. They use /responses/compact, which keeps around every user message ever sent for the whole duration of the entire session history. Only assistant messages, reasoning and some tool calls are really removed. Maybe, I misunderstand the code, but this seems like an issue for longer threads honestly.

alexeichhorn avatar Feb 06 '26 22:02 alexeichhorn

I’m seeing the same behavior.

When I run multiple web tool calls (search_query / open / find) in one turn, the context meter in the UI barely moves, and then the turn fails with context_length_exceeded.

From a user perspective, it looks like web-tool context is not reflected in live token usage.

Could this be improved by:

  1. Including web-tool context in the live context meter (or showing a separate hidden/tool-context counter),
  2. Updating the meter after each tool call (not only at turn completion),
  3. Adding a client fallback: on context_length_exceeded, auto-compact and retry once.

This would make token behavior much clearer and prevent surprising failures.

JiepengLab avatar Feb 10 '26 21:02 JiepengLab

yes, i r right @JiepengLab , i have the same feeling (in point 3, maybe is out of context), but i haven't review the codex code, so that i am not sure.

so, maybe the warning can make more clearly @etraut-openai

swoiow avatar Feb 11 '26 03:02 swoiow

how can earlier history be cleared

siridris avatar Feb 13 '26 01:02 siridris

still seeing this in latest version 0.104.0

yyyyaaa avatar Feb 24 '26 07:02 yyyyaaa

@yyyyaaa, if you have that thread available still, please use /feedback to upload its contents and post the thread ID here.

etraut-openai avatar Feb 24 '26 16:02 etraut-openai

@etraut-openai here's one I just had the problem: 019c9db2-f55d-7e70-bc46-3873bb460bad

I noticed that it's always in the middle of tool calling and getting responses from tool calls

yyyyaaa avatar Feb 27 '26 06:02 yyyyaaa

@etraut-openai 019cc95e-222b-7fa3-b3a0-64c2757aa46c the context ran out but I only used one message, it just started happening today

schooldev49 avatar Mar 07 '26 17:03 schooldev49

@etraut-openai 019ccb39-9fe9-7de1-ab21-f5aef3e49b28

chownation avatar Mar 08 '26 14:03 chownation

@etraut-openai 019cd190-df10-7d53-b3a3-068d8beb24e8 on CodeX App for mac

CaixyPromise avatar Mar 09 '26 09:03 CaixyPromise

@etraut-openai 019cde40-84b5-7971-8718-5b1ad678248f on CodeX App for Mac M4 Pro

zsecducna avatar Mar 11 '26 19:03 zsecducna

@etraut-openai 019cf9f7-b03c-7913-bcd8-1543b3157f2d

Codex 5.3 Spark is effectively unusable for me, since this tends to happen after a turn or two. This happened when I tried Spark for the first time at least a week ago; today I decided to try it again but ran into this issue again.

petekp avatar Mar 17 '26 04:03 petekp

Image I am also facing the same issue here, I am using GPT-5.4 on Azure AI Foundry `019d078e-b23b-76a3-bce7-abae58560b7d`

Liquid72 avatar Mar 19 '26 20:03 Liquid72

same issue 019da230-dc53-7f10-8e23-b95079c8a8c1

TerrorJack avatar Apr 18 '26 20:04 TerrorJack

even with the latest release ((v0.98.0), I am getting the same error repeatedly and quite often ■ Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.

I just downgraded and pinned my version to v0.80.0 (haha). It has fewer latest skills but works with other models. When I start a new conversation, I don't get the 'Codex ran out of room' warning. @sriinnu

I tried without any skills, but still face the issue.

sriinnu avatar Apr 20 '26 08:04 sriinnu

This is a usage stopping issue that propped up since yesterday. I rolled back to 0.120 its teh same. think its related to remote compaction. @etraut-openai A blocker for getting any actual work done with codex as the harness seems to stop every 5-10 minutes recently.

Or mention your thread ID 019db9e0-74c2-7cf3-8e5c-5de5246f7311 in an existing issue.

ShravanSunder avatar Apr 23 '26 12:04 ShravanSunder