Skip to content

Codex CLI loses conversation history after session resume (history truncated) #15709

Open

Description

@AhmedAlNeaimy

What version of Codex CLI is running?

codex-cli 0.116.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4 xhigh

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

VSCode, Antigravity

What issue are you seeing?

Codex CLI intermittently loses a significant portion of conversation history after resuming a session.

During active usage, everything works normally and the conversation history appears intact. However, after closing the session and later resuming it, a large segment of the conversation (typically between the session start and the point it was closed) is missing.

The history appears to be truncated or cut off, making it impossible to access previous context, which disrupts workflow and continuity.

This issue does not happen immediately but occurs after working for a while within the same session.

What steps can reproduce the bug?

Start a new session in Codex CLI
Interact normally with the CLI (multiple prompts and responses over a period of time)
Ensure a reasonably long conversation is built
Close the session
Resume or reopen the same session
Observe that a portion of the conversation history is missing (cut off), especially earlier interactions within that session

What is the expected behavior?

No response

Additional information

No response

Activity

  1. etraut-openai commented on Mar 25, 2026

    @etraut-openai
    Contributor

    There are parts of a conversation that are not persisted to disk as part of the rollout file — for example, tool and MCP outputs. Can you provide more details about which parts of the conversation you see missing? If you look in the corresponding rollout jsonc file, do you see any missing parts present in the file? I'm trying to determine whether this is 1) expected behavior, 2) a case where items are not written to the persisted rollout file, or 3) a case where items are present in the rollout file but not being properly restored and/or displayed.

    If you still have this session around, could you resume it and use /feedback to upload it, then post the thread ID here. That will allow us to investigate further.

  2. jabdori commented on Mar 27, 2026

    @jabdori

    @etraut-openai, i have same missing context issue, 019d2cf0-0162-70f3-a5fe-b4d066b2288f

  3. added
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    and removed
    agentIssues related to the core agent loop
    on Apr 11, 2026
  4. smith558 commented on May 28, 2026

    @smith558

    Observing the same issue. On codex resume xyz, a chunk of the initial conversation is gone

    e.g.

    Image
  5. smith558 commented on May 28, 2026

    @smith558
    Screencast.from.2026-05-28.21-43-32.mp4
  6. Necmttn commented on Jun 21, 2026

    @Necmttn

    Resume should validate replay completeness before presenting the session as restored.

    Compare session index metadata, rollout JSONL item count, first/last event ids, and the last persisted event id used for replay. If the replay is truncated, show a degraded resume state and keep the raw transcript available instead of letting missing history look like normal context.


    Generated with ax.

  7. wrobelda commented on Sep 4, 2026

    @wrobelda

    I had a similar issue and just confirmed that #42369 fixes it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archiving

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions