[BUG] VS Code Codex thread hangs during web/tool search and UI loses recent messages
What issue are you seeing?
In VS Code Codex, the thread hung while the assistant was doing web/tool search. After that, the UI appeared to lose the latest part of the conversation and only showed the beginning of the thread.
The session data was not fully lost: the missing turns were still present in the local session JSONL under ~/.codex/sessions/..., so this looks like a UI restore/reconnect/history rendering bug rather than total data loss.
I also hit a separate recurring compact error in the same environment:
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
What steps can reproduce the bug?
- Use Codex in VS Code on macOS.
- Continue a long-running thread.
- Let Codex perform web/tool work for a while.
- The thread hangs.
- After the hang/reconnect, the UI no longer shows the latest messages, but the missing content still exists in
~/.codex/sessions/...jsonl.
What is the expected behavior?
The thread should recover cleanly after hangs/tool failures, and the UI should restore the full recent conversation instead of dropping the latest visible turns.
Additional information
- Platform: macOS
- Surface: VS Code Codex extension
- Session evidence recovered from local session file
- Related local artifacts:
~/.codex/sessions/2026/04/01/rollout-2026-04-01T10-12-51-019d47e3-494a-7ae1-b05f-622c2cc8e853.jsonl~/Library/Logs/com.openai.codex/2026/04/01/
Notes
The local session file preserved assistant/user messages that the UI no longer displayed, which strongly suggests a restore/rendering/history-sync issue after the hang.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I’m seeing a very similar issue with the VS Code extension history rendering.
Environment:
openai.chatgpt@26.519.32039In my case, the same Codex thread is fully visible in
codexCLI, including all turns, but the VS Code extension only shows the first user message after reopening the thread from history.Additional observations:
thread/readwithincludeTurns: truecan read the full thread history.From inspecting the installed VS Code extension bundle, the reopen path appears to call
thread/readwithincludeTurns: falsefor metadata first, and full turn hydration seems to depend on auseTailHydrationfeature gate. When that hydration path is not enabled or does not run, the UI can reopen the thread with only cached/initial content.The app-server API already has the pieces needed to avoid this:
thread/readsupportsincludeTurns: truethread/turns/listcan page stored thread historythread/resumesupportsinitialTurnsPageDocs: https://developers.openai.com/codex/app-server#threads
A possible fix would be for the VS Code extension to always hydrate recent turns when opening/resuming a stored local thread, either via
thread/resume+initialTurnsPage, or viathread/turns/listwiththread/read(includeTurns: true)as a fallback, instead of depending on a gated tail-hydration path.