Skip to content

VS Code extension drops turn-scoped items and recent chat history during active thread #35304

Open

Description

@FUFU407

What version of the IDE extension are you using?

v26.721.30844

What subscription do you have?

ChatGPT Business

Which IDE are you using?

Visual Studio Code

What platform is your computer?

Darwin 25.5.0 arm64 arm (macOS 26.5)

What issue are you seeing?

Summary

While using a long-running active Codex thread in the VS Code extension, recent conversation/tool items disappeared from the visible chat history. This happened during the active session, not only after a VS Code restart.

The issue appears to be a mismatch between the extension UI, the Codex app-server connection, and turn state. Tool-related items arrive after the client has lost the associated turn state, so they are dropped.

Relevant logs

Local timestamps, with thread and item identifiers redacted:

2026-07-25 08:38:05.527 [warning] [CodexMcpConnection] cli:
dropping turn-scoped item for unknown turn id `<redacted>`
item_id="exec-<redacted>"

2026-07-25 08:38:05.528 [error] [CodexMcpConnection] cli:
codex_app_server_protocol::protocol::thread_history:
dropping turn-scoped item for unknown turn id `<redacted>`

codex_analytics::reducer:
dropping turn tool count update: missing turn state
thread_id=<redacted> turn_id=<redacted> item_id="exec-<redacted>"

2026-07-25 08:38:05.534 [error]
Item not found in turn state itemId=exec-<redacted>

2026-07-25 08:39:27.102 [warning] [IpcClient]
Received broadcast but no handler is configured
method=thread-read-state-changed

### What steps can reproduce the bug?

Open VS Code with the Codex extension signed in.
Work in a long-running thread with tool calls and multiple turns.
Continue working for an extended period.
Observe that recent conversation or tool items can disappear from the visible thread.
Check the VS Code Extension Host output.

### What is the expected behavior?

The extension should retain and render all turns and tool results belonging to the active thread. If state recovery is needed, it should rehydrate the missing turn instead of silently dropping associated items.

### Additional information

This was observed on macOS while working in an active long-running thread with tool calls. I did not manually edit or delete Codex session/state files.

I can provide additional sanitized VS Code Extension Host logs if needed.

Related issue: #14812

Activity

  1. added
    extension
    on Jul 25, 2026
  2. added
    bug
    app-server
    session
    on Jul 25, 2026
  3. github-actions commented on Jul 25, 2026

    @github-actions
    Contributor
  4. fundgrube24 commented on Nov 16, 2026

    @fundgrube24

    Additional Windows 10 Codex Desktop reproduction on 2026-11-16 (client 26.1111.21308), correlated with thread/resume and one thread/fork:

    • Local logs_2.sqlite contains 136 codex_app_server_protocol::protocol::thread_history: dropping turn-scoped item for unknown turn id warnings.
    • Those 136 warning rows concern only five distinct turn IDs (counts 66, 24, 23, 16, 7), across five existing threads, NOT 136 missing chats.
    • Every referenced turn exists in the corresponding original rollout.jsonl (task_started event was inspected at its stored byte offset), in thread_history_1.sqlite.thread_turns (status completed), and in thread_history_1.sqlite.thread_items (36–387 items per affected turn).
    • For all five affected threads, the history projection offset equals the current rollout file size. PRAGMA quick_check is ok for the state and history DBs. All current thread rollout paths exist, and there are no inProgress turn statuses in the current history DB.

    Thus, the sampled warnings indicate an app-server/UI turn-replay association failure during resume/fork, not that the underlying on-disk turn data is missing. The user-visible retention of every item still needs an official thread/resume acceptance test.

    Please investigate why the replay drops items that are present in the stored rollout and projected history, and provide a supported recovery/rehydration path which does not require deleting history, editing SQLite, or discarding tool results. Source files, session identifiers, personal paths, credentials and raw logs are not published here.

  5. dyehya commented on Nov 29, 2026

    @dyehya

    Additional Windows VS Code reproduction — November 29, 2026

    Environment: Codex VS Code extension 26.1120.50957 on Windows x64; a long-running persistent paginated thread with two prior native recovery/revert operations and a three-segment rollout history.

    A resume logged 1,030 distinct dropping-turn-scoped-item/unknown-turn-ID pairs. A read-only inspection and offline index built from a verified backup found:

    • All 1,030 items in the local history projection under the current rollout-specific UUID rather than the original logical thread UUID.
    • All 1,030 exact item_completed events in the canonical raw rollout; all explicit turn IDs match the warning pairs.
    • 511 tool-call records with 511 matching function-call outputs, 496 execution items, and 23 subagent completion items.
    • All three segments' history-base cutoffs, record boundaries, and projection byte/ordinal endpoints verified. Compressed predecessors decompress to previously recorded hashes.
    • One completion falls outside its enclosing task interval but retains its explicit earlier turn ID.

    The thread subsequently reopened and another compaction completed. We have not independently established that the renderer or model context includes every affected item. The evidence suggests a turn-association/history assembly issue across recovered rollout segments, not proven incorrect storage of segment IDs themselves.

    Please investigate persistent paginated-thread hydration and turn reconstruction across predecessor rollouts, including events referencing earlier or terminal turns. Deterministic minimal reproduction and code-level root cause are not yet established. No rollback, live database modification, or reimport was performed during this investigation. Raw conversations, exact identifiers, local paths and credentials are omitted.

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

    app-serverbugextensionsession

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions