Codex App upgrade can break opening older local threads when rollout session_meta lacks thread_source

Resolved 💬 5 comments Opened May 16, 2026 by Minghou-Lei Closed May 16, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Upgraded from 0.130.0-alpha.5 to 0.131.0-alpha.9.

What subscription do you have?

ChatGPT Plus / Codex-enabled individual subscription.

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

After upgrading the Codex App, newly created threads open normally, but many pre-upgrade local threads fail to open in the desktop app and render the generic error UI:

Oops, something went wrong

This affected old local threads only. The underlying local rollout files were still present and valid JSONL, and new post-upgrade threads were healthy.

I investigated the local session files and found a consistent metadata mismatch:

  • working new threads created after upgrade had session_meta.payload.thread_source
  • broken old threads created before upgrade often did not have session_meta.payload.thread_source
  • those old rollout files were otherwise valid and readable

On my machine, locally backfilling thread_source: "user" into the indexed old rollout files under ~/.codex/sessions/**/rollout-*.jsonl restored the broken threads.

So this looks like a desktop compatibility / migration regression for older local rollout metadata, not a data loss issue.

PII note:

  • I am not attaching raw local session payloads
  • thread IDs below are real local examples but contain no user content
  • absolute local paths are omitted except for the standard ~/.codex storage layout

What steps can reproduce the bug?

  1. Use Codex App on Windows with local session history already present from an older app version.
  2. Have at least one older local thread created by 0.130.0-alpha.5 where the first JSONL line (type=session_meta) lacks payload.thread_source.
  3. Upgrade Codex App to 0.131.0-alpha.9.
  4. Open a new thread after upgrade: it works.
  5. Open one of the older local threads: the app shows the generic error UI instead of loading the thread.

Representative local thread IDs I used while debugging:

  • works after upgrade: 019e2ffa-66a8-7073-8b8f-a24fe3b96c86
  • broken before local repair:
  • 019e2b25-4ce4-7073-a2bb-974d8c56021e
  • 019e2ad4-4455-70e1-8633-76bd7c64fc6b
  • 019e24a9-999c-73d3-9fff-92b360ae3e7b
  • 019e201a-f2c1-7093-aad2-82de2d35d842

Observed local evidence:

  • session_index.jsonl still listed the threads
  • rollout files still existed under ~/.codex/sessions/YYYY/MM/DD/
  • rollout files were valid JSONL
  • the key structural difference was missing session_meta.payload.thread_source on many older user threads

Local mitigation that fixed the issue:

  1. scan indexed rollout files
  2. for each visible top-level thread with missing thread_source
  3. backfill thread_source: "user" into the session_meta payload
  4. restart Codex App

After that, the previously broken old threads opened again.

What is the expected behavior?

Upgrading the Codex App should not break opening older local threads.

If older rollout metadata is missing a now-required field like thread_source, the app should either:

  • tolerate the missing field and infer a safe default for old local top-level threads, or
  • run a local migration/backfill when reading old rollout files

The app should never show a generic unrecoverable error UI for otherwise valid historical local threads solely because a new metadata field was introduced.

Additional information

Additional debugging details:

  • This looked specific to pre-upgrade local threads, not newly created threads.
  • A full local scan on my machine showed the indexed / visible threads became healthy once thread_source was backfilled.
  • I suspect the right long-term fix is in the desktop / app-server compatibility path that reads old rollout session_meta, rather than asking users to mutate local history files manually.

Useful places to inspect in the repo:

  • desktop / app conversation loading path
  • app-server conversation summary / thread summary loading from rollout files
  • any session metadata migration / compatibility layer

I also noticed the repo already has app-server test fixtures that explicitly create rollouts with thread_source: None, which may be a good starting point for a regression test.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #22984

Powered by Codex Action

Minghou-Lei · 3 months ago

I have an additional data point from a local mitigation that consistently restored the broken pre-upgrade threads on my machine.

This was done with a sanitized local compatibility repair, not by recreating threads and not by recovering from backups.

Observed repair rule:

  1. Read ~/.codex/session_index.jsonl to identify user-visible local thread IDs.
  2. Scan ~/.codex/sessions/**/rollout-*.jsonl.
  3. For each rollout:
  • parse the first JSONL line
  • if it is type == "session_meta"
  • and payload.id is present in session_index.jsonl
  • and payload.thread_source is missing or empty
  • then backfill payload.thread_source = "user"
  1. Restart Codex App.

Important safety constraint:

  • do not blindly infer thread_source for every rollout on disk
  • only repair indexed / user-visible top-level threads
  • do not overwrite existing thread_source values such as subagent threads

Minimal sanitized Python version of the local repair logic:

import json
from pathlib import Path

codex_home = Path.home() / ".codex"
session_index = codex_home / "session_index.jsonl"
sessions_root = codex_home / "sessions"

indexed_ids = set()
for line in session_index.read_text(encoding="utf-8").splitlines():
    if not line.strip():
        continue
    try:
        indexed_ids.add(json.loads(line)["id"])
    except Exception:
        pass

for rollout in sessions_root.rglob("rollout-*.jsonl"):
    lines = rollout.read_text(encoding="utf-8").splitlines()
    if not lines:
        continue

    try:
        first = json.loads(lines[0])
    except Exception:
        continue

    payload = first.get("payload") or {}
    thread_id = payload.get("id")
    if thread_id not in indexed_ids:
        continue
    if payload.get("thread_source"):
        continue

    payload["thread_source"] = "user"
    lines[0] = json.dumps(first, ensure_ascii=False, separators=(",", ":"))
    rollout.write_text("\\n".join(lines) + "\\n", encoding="utf-8")

This local repair fully restored the old broken threads for me.

Additional verification from the repaired dataset:

  • all indexed / user-visible rollout files became compatible
  • newly created post-upgrade threads were already fine and were left unchanged
  • non-indexed rollouts were intentionally not inferred / rewritten

I also wrote local tests for this repair rule before applying it, covering:

  • indexed rollout with missing thread_source gets repaired
  • rollout not present in session_index.jsonl is not modified
  • rollout with an existing thread_source is preserved

This is obviously only a mitigation, not the correct product fix. But it strongly suggests the app should either:

  • treat missing thread_source on older local rollout metadata as a backward-compatible user default when appropriate, or
  • run a built-in one-time metadata migration for historical local rollouts.
Nickhoho · 3 months ago

Additional Windows data point from another machine after upgrading Codex Desktop.

Observed behavior:

  • After upgrading Codex Desktop, clicking older local sidebar threads shows the generic error UI: Oops, something went wrong
  • Check for updates and Retry do not recover the thread.
  • Re-authorizing the Codex / ChatGPT login state also does not recover the thread.
  • Newly opened/current threads still work.

Environment:

  • Windows Codex App package: OpenAI.Codex 26.513.3673.0
  • Current desktop/app telemetry version observed in logs: 0.131.0-alpha.9
  • Affected historical thread was created with cli_version: 0.130.0-alpha.5
  • Current bundled nested CLI under AppData\Local\OpenAI\Codex\bin\76ac88818493fc45\codex.exe reports codex-cli 0.131.0-alpha.9
  • Top-level AppData\Local\OpenAI\Codex\bin\codex.exe still reports codex-cli 0.130.0-alpha.5, so the machine also has mixed old/new CLI binaries after update.

Affected local thread example:

  • Thread id: 019e2bfc-163c-7750-9829-460a1d9135d4
  • Local rollout file exists under ~/.codex/sessions/2026/05/15/
  • File size: 8031308 bytes
  • JSONL validation: 3874 lines, 0 invalid JSON lines
  • First JSONL line:
  • type=session_meta
  • payload.id=019e2bfc-163c-7750-9829-460a1d9135d4
  • payload.cli_version=0.130.0-alpha.5
  • payload.source=vscode
  • payload.thread_source is missing

This independently matches the suspected compatibility issue described here:

  • the historical rollout file is still present
  • the rollout file is valid JSONL
  • the thread was created by 0.130.0-alpha.5
  • the desktop app after update is 0.131.0-alpha.9
  • thread_source is missing from session_meta.payload
  • the desktop UI fails to open the old thread with the generic error page

I am not attaching raw session files because they contain user/workspace content. This comment only includes sanitized metadata and validation results.

etraut-openai contributor · 3 months ago

We've issued a hotfix to address this. Please update to the latest version.

shleder · 9 days ago

When older local sessions fail to open after app updates because session_meta records lack newly expected schema fields (such as thread_source), Codex Rescue can diagnose the schema drift across your historical rollouts without modifying them in place.

You can inspect persisted schema generations and coverage across your local sessions using:

npx --yes codex-rescue schema

Or run doctor on the latest session:

npx --yes codex-rescue doctor --latest

It runs completely locally and read-only. If you run it, sharing whether it flags the schema gap on your older sessions would provide useful field signal.