codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex replies to earlier messages instead of latest one in conversations

Open BobbyWang0120 opened this issue 11 months ago • 89 comments

What version of Codex is running?

0.77.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.2-xhigh

What platform is your computer?

No response

What issue are you seeing?

In multi-message conversations with Codex, the assistant sometimes responds to an earlier message instead of the most recent one. For example, I had a conversation with six messages. By the sixth message, I had moved on to asking a different question, but Codex's final summary acted as if it was still on the third message. The third message asked about a question A and its solution, while the sixth asked about question B. Even though the topic changed at the sixth message, Codex still responded about question A. This happens frequently and suggests that Codex may be referencing the wrong message in the conversation history.

What steps can reproduce the bug?

  1. Start a conversation in Codex and send several messages (e.g., six messages).
  2. In an earlier message (e.g., the third message), ask question A and wait for a response.
  3. In a later message (e.g., the sixth message), ask a different question B.
  4. Observe that Codex's summary or response refers back to question A rather than answering question B.
    This suggests that Codex is using the wrong message as context.

What is the expected behavior?

Codex should respond to the current message, acknowledging the latest context. After a user moves from question A to question B, the assistant should answer question B and not revert to a previous question. The summarization should maintain the correct message pointer in the conversation.

Additional information

the pattern is randomly happening, and it has a higher chance to happen after we compacting the context within the conversation

BobbyWang0120 avatar Jan 01 '26 08:01 BobbyWang0120

I also frequently see this behavior. Codex repeats previous responses (at least 1) although it didn't work on the same topic in the last task. Here, too, it is in the context of a huge project (GPT-5.1-Codex-Max with High effort, Local Agent mode, ~60% context window. I never tried to "compact the context" (didn't even know that this is possible)

g3grau avatar Jan 01 '26 12:01 g3grau

Please use the /feedback slash command to upload your session and post the thread ID here.

etraut-openai avatar Jan 01 '26 17:01 etraut-openai

I've been seeing this too - only since updating to the latest version of the plugin.

My feedback thread ID: 019b1a35-5b10-7741-93bb-58589661a52c

MineshK avatar Jan 03 '26 22:01 MineshK

Thanks for reporting. We are aware of this issue with compacted conversations and are working on a fix.

sayan-oai avatar Jan 05 '26 22:01 sayan-oai

Reporting the same issue after a session where it was particularly bad. In my experience Codex has been bad at tracking which questions are "new" and which issues it has already responded to even in its early days. It has been quite typical to see conversations of this style as long as I have been using Codex:

User - Fix issue A Codex - Fixed issue A User - Fix issue B Codex - Fixed issue A. Fixed issue B.

I have never seen the same issue with other agent harnesses, although I have not really explored codex models through Cursor for instance. It also now seems to worsen after compaction (I would rarely let conversations run to the point of compaction before, so unsure if recent changes to compact earlier is just making this problem more visible).

Submitted the conversation through /feedback with the following tracking number: 019bdad1-8b88-7c82-bd9e-48a0b4ba835f

STAlfsen avatar Jan 21 '26 12:01 STAlfsen

Yeah after summarization, the chat is unusable and the model just loses context or fixes previously fixed bugs

sentialx avatar Feb 06 '26 00:02 sentialx

This issue is getting worse and worse all the time. It's made 5.3 pretty much unusable.

alc1986 avatar Feb 09 '26 13:02 alc1986

I’m seeing the same issue since 0.98. It’s burning through my Pro limits, roughly 0.5–1% of the weekly limit per prompt.

Yesterday, a very small change took 23 minutes and modified ~20 files instead of a single line. Most of those edits were redundant (same change repeated with only minor style differences).

Right now, it’s completely unusable with gpt-5.3-codex and barely usable with gpt-5.2-codex.

If this isn’t fixed ASAP, I’ll have to switch to Claude or Gemini. I’m a big fan of Codex, but I need a tool I can actually ship work with.

svendvd avatar Feb 10 '26 13:02 svendvd

This is also happening to me. But with Context compact. i did open a ticket, but it got closed. So I am adding it here. When doing tasks with Codex and Context compact, it does its thing. Codex jumps to previous tasks and starts redoing things it has already completed. It's getting really annoying now; I have to stop it or allow it to carry on at the risk of breaking the project. It's a waste of my time and wastes my usage/money allowance. This needs fixing. It's been like this now for the last couple of updates. Using Codex with Node CLI in the terminal.

This is getting serious now. I am editing grub menu settings. And I get a context compact. Right after it finishes, instead of carrying on editing, Codex has switched context from a day ago and started editing, something that's nothing to do with what i am doing now.

Rhino-85 avatar Feb 11 '26 17:02 Rhino-85

+1 I also see this issue, and I've only seen it happen after context compact. thread id: 019c98cb-6021-7da3-90e9-2eb092b6fe49

henry-dowling avatar Feb 26 '26 07:02 henry-dowling

Seeing this issue a lot lately, didn't have much problem with it before. It got substantially worse with the release of gpt-5.4

dzigz avatar Mar 08 '26 10:03 dzigz

agree this seems to be happening much more often now

ncarrillo avatar Mar 08 '26 16:03 ncarrillo

Since 5.4 this has become a NIGHTMARE.

Tsury avatar Mar 08 '26 21:03 Tsury

Happens literally every day. Keeps answering previous messages and ignoring my actual latest message

dev-mirzabicer avatar Mar 12 '26 14:03 dev-mirzabicer

This issue is burning through my tokens so badly it's not even funny. Codex just worked on "fixing bugs" for 30m only to end up replying about the previous prompt. This is approaching a show stopper real quick.

Tsury avatar Mar 12 '26 15:03 Tsury

Here's a thread ID I reported /feedback on with the issue: 019cee34-5e10-76a3-8c8c-42ff92321027. Using Codex App on macos with 26.311.21342 (993)

The thread was something like:

user: How is the persistence currently implemented? Would the be better as something like a local sqlite database?

In the current working tree, worker-local persistence is a simple file-backed state store, not a database. It works like this: Runtime state lives in memory as a BTreeMap under an RwLock in state.rs (line 18).

user: Please use SQLite and benchmark it and compare directly. I feel like it would be cleaner to implement for the data. Also, consider using it for the resume state too

Current worker-local persistence in the working tree is: In-memory state is a BTreeMap under an RwLock in state.rs (line 18). Startup reads a full snapshot from worker-state.json, replays an append-only j

lgo avatar Mar 15 '26 18:03 lgo

Seeing something egregious happening as well, especially with the review.

/review pr1

here is my pr1 review

/review pr2

here is my pr2 review

/review pr3

here is my pr1 review <---- Issue


This seems to get worse over time. It also seems somewhat random and inconsistent, but what even doesn't help is when I run /new

So there's some weird complex session or state management issues going on.

backnotprop avatar Mar 18 '26 04:03 backnotprop

This has gotten significantly worse in the past week with 5.4, making Codex near-unusable with anything but the shortest of chats.

seifip avatar Mar 20 '26 07:03 seifip

This has gotten significantly worse in the past week with 5.4, making Codex near-unusable with anything but the shortest of chats.

It's even happening with 5.3-codex now, which is a huge regression. Switched to Claude Code for now.

alc1986 avatar Mar 20 '26 07:03 alc1986

+1, this has happened to me on a daily basis. It doesnt seem to be an instruction or attention issue, more like compaction-issue. Once it happens, next few turns will basically keep ignoring my last message.

I have a few thread ids to share with the team if that helps.

MonkeyLeeT avatar Mar 26 '26 03:03 MonkeyLeeT