VS Code extension loses thread history after restart on Linux even though auth session is restored
What version of the IDE extension are you using?
26.5311.21342
What subscription do you have?
Github Copilot +
Which IDE are you using?
VS Code
What platform is your computer?
Ubuntu 24.04.4 LTS
What issue are you seeing?
After closing and reopening VS Code on Ubuntu, the Codex VS Code extension appears to lose previous conversations/thread history in the UI.
This initially looks like an authentication/session loss, but the logs suggest auth is actually being restored correctly. The visible failure seems to be in thread/session restore or UI hydration after restart.
Relevant findings:
editSessions.logshows the same authentication session being restored successfully- rollout/session files still exist under
~/.codex/sessions Codex.logshows thread-state related errors such as:No promise for request IDReceived broadcast but no handler is configured method=thread-stream-state-changedItem not found in turn state
I also previously saw:
state db backfill not complete at /home/.../.codex (status: pending)
After rebuilding the local Codex SQLite state files, that backfill warning disappeared, but the thread/history restore issue still remains.
What steps can reproduce the bug?
- Open VS Code with the Codex extension installed and signed in.
- Use Codex normally and create one or more conversations.
- Fully exit VS Code.
- Reopen VS Code.
- Open the Codex sidebar/panel and wait for initialization.
For me, previous conversations are no longer restored in the UI after restart.
What is the expected behavior?
Codex should restore the existing signed-in session and preserve previously visible conversation/thread history after restarting VS Code.
The extension should reopen with prior threads still available instead of appearing as if history or session state was lost.
Additional information
Environment:
- OS: Ubuntu 24.04.4 LTS
- Desktop: GNOME
- VS Code: manual install, not Snap
- Extension:
openai.chatgpt - Extension version:
26.5311.21342
Important log evidence:
editSessions.log:
```text
Searching for existing authentication session with ID 2918bc5fd4425f38
Found existing authentication session with ID 2918bc5fd4425f38
Codex.log after restart contains:
No promise for request ID
Received broadcast but no handler is configured method=thread-stream-state-changed
Item not found in turn state
Additional possibly related message:
Error fetching errorMessage="local-environments is not supported in the extension"
url=vscode://codex/local-environments
What I already tried:
Restarting VS Code
Waiting after restart
Reinstalling the extension
Reinstalling VS Code
Verifying the Linux keyring/libsecret setup
Backing up and rebuilding ~/.codex/state_5.sqlite and ~/.codex/logs_1.sqlite
Result:
auth still restores
session rollout files still exist
backfill warning went away after rebuild
thread/history restore issue still remains
Codex.log
CODEX_VSCODE_AUTH_TROUBLESHOOTING.md
CODEX_VSCODE_BUG_REPORT.md
editSessions.log
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reviewed the suggested duplicates and I don’t think this issue is a direct duplicate.
Closest related issue:
Conversation not found/no rollout found)Other related issues with overlapping extension warnings:
Why I’m keeping this open:
So this seems related to the same extension state/IPC family, but not the same end-user failure mode.
I can confirm a related VS Code extension / Linux metadata-hydration bug.
Concrete example from my machine:
019ca226-b30c-7181-bdf0-62b891464a25~/.codex/session_index.jsonlstill hadthread_name = "Worker"~/.codex/state_5.sqlitehadtitle = ''andfirst_user_message = ''for the same thread idResult:
WorkerAfter manually updating the row in
state_5.sqliteso thatthreads.title = 'Worker', the thread became visible in the extension immediately after reload.This suggests the extension is trusting recent-thread metadata/state too much and does not repair blank titles from disk-backed sources.
Relevant code paths from the current extension sources / sourcemaps:
src/app-server/app-server-manager.tsupsertRecentConversationState()around lines1389-1415title: persistedTitlearound line1472src/local-conversation/get-local-conversation-title.tsconversation.title, first turn input text, and parent subagent promptsession_index.jsonl, rollout JSONL, or recovery historySo this is not only “history lost after restart”; it can also be “history present on disk but undiscoverable because blank titles are never repaired”.
Windows 11 repro here with the current VS Code extension, and the failure pattern matches this issue.
Environment:
openai.chatgpt26.325.316541.113.0%USERPROFILE%\\.codexObserved behavior:
.codexworks, but the extension does not restore them correctly in the UI.Confirmed local state:
%USERPROFILE%\\.codex\\state_5.sqlite(threadstable).%USERPROFILE%\\.codex\\sessions\\2026\\03\\31\\.Key failing threads on this machine:
019d44bd-7f5c-7e21-8ed0-f681a1e03b2c019d44c9-2f2b-7270-83fc-631cd4e57795Extension log symptoms after restart:
Item not found in turn stateReceived broadcast but no handler is configured method=thread-stream-state-changedConversation state not foundduring investigationImportant detail from local repair attempts:
openai-codex://route/local/...entries from the active VS Code workspacestate.vscdb.agentSessions.state.cachestayed clean, butagentSessions.model.cachewas repopulated by the extension.Item not found in turn stateerrors.That suggests the durable Codex store is intact, but the VS Code extension’s restore / turn-state hydration path is rebuilding broken session pointers or failing to hydrate from the persisted rollout/thread data.
I also saw unrelated extension-side errors during startup such as:
local-environments is not supported in the extensionThose may be noise, but the thread restore failure remains reproducible even after cache cleanup.
Practical conclusion from this Windows repro:
.codexfilesIf useful, I can provide a sanitized list of the exact workspace DB keys and the before/after cache counts from the successful cleanup run.
do it this and solve ok on windwows or similar for mac/linux
setx CODEX_HOME 'C:\Users\your_user\.codex'
I’m seeing what looks like the same underlying issue, but in VS Code + WSL.
In my case, this is not full history loss. It is more like partial / thread-specific restore failure:
Important detail:
This makes me think the root issue is still thread/session restore or sidebar/UI hydration after restart.
Feedback session ID:
5163bfa8-60d4-4787-8da4-e37f535414a3
Additional finding:
I found a much more specific repro path.
When I open VS Code and land on the initial CODEX view, I see the recent tasks list. If I click tasks from that initial recent-tasks view, the thread does not open correctly.
However, if I open the same task through Task history, the exact same thread opens correctly and the full content loads.
I tested this with multiple tasks:
This suggests the problem may not be transcript loss or broken local storage. It looks more like a bug in the initial recent-tasks entry point / navigation / task resolution, while Task history uses a different and working restore path.
Additional note:
For one failing thread, the UI showed the context window around 75% full (~193k / 258k tokens). I am not sure this is causal, but mentioning it in case it is relevant to restore/hydration behavior.