Regression: interrupted agent messages vanish from conversation history

Resolved 💬 4 comments Opened Aug 27, 2025 by snipeship Closed Nov 22, 2025
💡 Likely answer: A maintainer (oyiakoumis, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

HEAD

Which model were you using?

gpt-5

What platform is your computer?

_No response_

What steps can reproduce the bug?

  1. Cut off the model while it's streaming output tokens
  2. Send another message asking what it was talking about or why it was cut off
  3. ->> It has no idea

What is the expected behavior?

The model should know it was cut off and have the partial response in context

What do you see instead?

The conversation in the TUI shows the partial messages, but the model sees gaps in the conversation history.

Additional information

Regression introduced in #2758
cc @aibrahim-oai

View original on GitHub ↗

4 Comments

oyiakoumis contributor · 1 year ago

I’ve committed a change (fc48476), but there’s a race condition between chat messages and conversation messages, with the latter sometimes arriving ahead of the former. This causes the last conversation message to occasionally appear longer than the last chat message. I’ll take a closer look tomorrow.

techjoec · 1 year ago

+1 this really is a big deal.

I often have to halt codex from running with scissors or realized I have a few tokens that would really help it scope the work better, and since we can't add context mid-stream I always hit Esc to refine the prompt. Sometimes I just resend the whole prompt with CORRECTION: or such, but other times if it's already ran off touching stuff, if it doesn't retrace its steps it ends up 'forgetting' it ran some commands and seems to sometimes just "rerun the plan" without replanning. If we cannot keep this context after an interruption, then I think the code really should force a new plan to be generated based on fresh file reads and such. Evidence: Have it do a bunch of folder moves or creates, stop it partway through, then try to resume. Watch it get file not found etc... That is my biggest headache in general with Codex today, that it is piss poor at tracking its actions. I have written a ledger system I force it to use, but the other headache crops up sometimes where it just decides to not do things like that...But I got my main repo fairly structured so it USUALLY writes to ledger. Been tempted to try to force it to do a pre-act and post-act write but ugh I'm already over 1b tokens this month with all the other crud.. :(

oyiakoumis contributor · 12 months ago

So I fixed the race condition I had. The PR is ready: https://github.com/openai/codex/pull/2943

Let's hope it will be merged soon.

etraut-openai contributor · 9 months ago

I think this bug is no longer relevant, so closing. If you are seeing similar behavior with the latest versions of codex, please open a new bug.