Skip to content

[Bug] Windows: migrated paginated threads show empty history with EOF projection but zero turns/items #44033

Open

Description

@xmleee

Environment

  • Windows 11; installed Codex package inspected during investigation: 26.901.6511.0.
  • Incident observed 2026-09-09, UTC+8.
  • Two long-running pinned local threads; no pre-incident backup on another computer is available.
  • This is a sanitized report. No private conversation text, repository names, usernames, thread IDs, local paths, authentication data, or raw attachments are included.

Observed behavior

Both threads remain listed, but their history is blank. Read-only application retrieval returns turns=[] with no more pages. Desktop logs show turnCount=0 and successful thread/read / thread/turns/list requests, not request timeout or protocol errors.

Both threads are marked history_mode=paginated. In consistent, read-only SQLite backup snapshots:

  • thread_turns, thread_items, and thread_realtime_items each contain zero rows for both affected threads.
  • thread_history_projection_state.next_rollout_byte_offset equals the end of each current rollout: 3,629,809 and 5,256,009 bytes.
  • Both JSONL files still contain nonempty user/assistant messages and compacted replacement_history / guardian_history.
  • SQLite quick_check returns ok; this does not establish logical history completeness.

One affected source previously had a metering-cache read offset of 710,450,171 bytes and thousands of historical token events; its current source is 3,629,809 bytes with retained metering timestamps collapsed to the old session creation time. Another affected source was previously about 267 MB and is now 5.26 MB. These cache observations establish a large source-format/content change, not recovery of the missing transcript.

Local evidence includes the legacy_to_paginated_v1 migration marker. The exact process that rewrote each file has not been proven by OS file-write auditing. No claim of malicious modification is made.

Expected behavior / impact

Existing conversation history should remain accessible through migration. A projection at EOF with zero turns/items should not silently present a nonempty stored thread as an empty conversation. If migration or projection is incomplete, the app should clearly report the condition and provide a supported, non-destructive recovery path.

These are important long-running work threads. Only partial plaintext has been extracted from the remaining structures; complete original conversation recovery has not been demonstrated.

Preservation / actions not taken

Affected source files, state/history databases with WAL/SHM, consistent SQLite backup snapshots, relevant desktop logs, and 487 related rollout files have been preserved locally. Readable plaintext fragments have been extracted offline only.

No source JSONL or source database has been manually edited by the investigator. No migration-mode change, projection rebuild, rollback, or recovery RPC has been attempted by the investigator.

A minimal synthetic reproduction is not yet available. The observations above are from the affected local installation; we have avoided potentially destructive reproduction attempts on the only original data.

Requested assistance

  1. Is there a known legacy-to-paginated migration/projection defect that produces EOF projection state with zero persisted turns/items?
  2. What is the supported, non-destructive recovery procedure for this exact state?
  3. Can any missing history be recovered from the remaining compacted/guardian structures or other official storage?
  4. How can further background migration be safely paused while preserving evidence?

Potentially related reports: #40342, #35746. Their reported projection failures may differ from this EOF-with-zero-rows state; we are not asserting an identical root cause.

Please request necessary diagnostics through a private channel. Full local logs and database snapshots contain sensitive project data and should not be posted publicly.

Activity

  1. added
    bug
    app
    windows-os
    session
    on Sep 9, 2026
  2. github-actions commented on Sep 9, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. DavDevFr commented on Sep 9, 2026

    @DavDevFr

    I can confirm a closely matching failure on three long-running local tasks under Windows.

    Additional distinguishing evidence

    All three affected rollouts have:

    • history_mode="paginated"
    • thread_source="subagent"

    Other older tasks belonging to other projects still display their historical messages normally, so this does not appear to be a global deletion of all local history.

    The affected tasks remain listed and can still be opened. However:

    • two tasks initially appeared with an empty transcript;
    • after sending a new message, only the new exchange became visible;
    • the task-reading API returns only the newest turn, with no cursor or indication that older pages remain;
    • a third affected task displays only messages starting around September 8 at 17:29 local time, although the task is substantially older.

    Local rollout evidence

    The three current JSONL rollouts contain explicit compacted records:

    • affected task A: 240 replacement_history entries;
    • affected task B: 229 replacement_history entries;
    • affected task C: two compactions containing 184 and 185 replacement entries.

    The replacement histories still contain many earlier user messages. This does not establish that every original assistant response remains recoverable, because assistant history appears to have been condensed into compaction data.

    The NTFS creation times of the current rollout files are also notable:

    • two affected rollouts were created on September 8 at approximately 17:27 local time;
    • the first remaining user-visible message is around 17:29;
    • the third affected rollout was created on September 9 at approximately 07:47.

    Update timing

    Windows AppX deployment logs show:

    • package 26.901.6511.0 registered on September 6 at approximately 19:43;
    • package 26.903.8094.0 registered on September 9 at approximately 07:46;
    • no Codex package registration event on September 8.

    Therefore, at least two affected rollout recreations occurred before the currently installed package update. This may indicate a lazy per-thread migration/projection operation rather than a single global deletion caused exclusively by the latest package installation.

    Difference from #43661

    Unlike #43661:

    • the local projects never disappeared;
    • no project was removed and re-added;
    • the thread shells and titles remained available;
    • the missing data is the older transcript inside those existing threads.

    Preservation

    A complete private backup of the local Codex data directory, including the rollouts and SQLite databases with their WAL/SHM files, was created and successfully tested before attempting any repair.

    No live rollout, database, migration state, or configuration file has been edited. No reprojection or rollback has been attempted.

    Could you confirm whether thread_source="subagent" is relevant to the affected legacy-to-paginated migration path, and whether a supported non-destructive reprojection/recovery procedure is available?

  4. noclascio commented on Sep 10, 2026

    @noclascio

    Same defect on macOS — filed as #44363 with byte counts and timestamps, in case a second platform
    helps triage.

    More urgently, since you preserved the data rather than attempting recovery: the pre-rewrite
    files may still exist in a filesystem snapshot
    , and that is a narrow window worth checking before
    anything else touches those volumes.

    In my case the rollout was rewritten in place at a timestamp I could read off the inode's birth
    time. An APFS local Time Machine snapshot from 12 minutes earlier still held the original —
    851 MB and 122,877 records, against the 7.1 MB / 762 records left behind. Mounting that snapshot
    read-only and copying the file out recovered the full conversation, assistant turns included.

    On Windows 11 the equivalent is Volume Shadow Copy: check vssadmin list shadows (elevated), or
    right-click the containing folder → Restore previous versions, and look for a copy dated
    before your threads shrank. File History, if enabled, is a second place to look. Both are worth
    checking now — VSS snapshots roll off on their own schedule.

    Two things I'd avoid until you have a copy out:

    • Don't let the app rewrite the affected threads further. On my machine the session was
      auto-loaded at app-server startup via startup_prewarm and kept the rollout open continuously.
    • Repopulating thread_items by hand does not help. For an always-loaded thread, thread/resume
      takes resume_running_thread and composes from the in-memory session, which starts empty on each
      load — it never reads thread_items. I verified this by reconstructing the rows in the
      migration's exact format (validated byte-exact against 5,480 rows across three
      correctly-migrated threads) and the UI still showed nothing.

    Worth checking whether your surviving JSONL still contains assistant messages. Mine kept only
    role: "user" entries inside the compacted record's replacement_history; if yours retains both
    sides, your recovery is far simpler than mine was.

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

    appbugsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions