Skip to content

[Windows][WSL] Desktop 26.1103 auto-migration breaks existing chats; switching back breaks chats created in Windows mode #60054

Open

Description

@YAOLQ2024

What version of the Codex App are you using?

Windows MSIX package OpenAI.Codex_26.1103.4239.0_x64. The Desktop logs report 0.167.0-alpha.3.2 for the local app-server and 0.167.0 for the remote Ubuntu app-server.

What subscription do you have?

Not provided.

What platform is your computer?

Windows 11 x64, build 10.0.26200.9711, with Ubuntu 24.04 LTS on WSL2.

What issue are you seeing?

On the first launch after updating to 26.1103, Desktop automatically switched from legacy WSL mode to the remote WSL flow. The migration logged stage=completed and remote Ubuntu connected, but several existing local chats created in legacy WSL mode failed to open. Desktop tried to resume them through the Windows-native local backend, which rejected saved /mnt/c/... workspace roots. File links in affected chats also failed to open.

I created a new troubleshooting chat while the local backend was running in Windows mode. It worked at the time. I then restored legacy WSL mode and restarted Desktop. The affected older chats I checked reopened from their original sidebar entries, but the troubleshooting chat now failed with “Unable to load messages.” The Linux backend rejected the Windows workspace root saved by that chat. Its transcript was still on disk. In an isolated app-server test, the same chat ID resumed and all four turns were readable when I supplied the equivalent Linux working directory and runtimeWorkspaceRoots.

After switching back, the composer shows a yellow banner saying that legacy WSL mode is active and inviting me to open WSL connections. Clicking it navigates to /settings/connections/wsl according to the Desktop log, but the visible settings page selects the SSH tab and lists only SSH hosts. There is no WSL tab or Ubuntu connection to select.

What steps can reproduce the bug?

  1. On Windows, use Desktop in legacy WSL mode with Ubuntu. Create and use a local project chat with a Linux-form workspace root, for example /mnt/c/Users/<user>/Desktop/<workspace>.
  2. Update to Desktop 26.1103 and relaunch on an installation enrolled in the remote WSL migration. Confirm that the migration completes and the remote Ubuntu app-server connects.
  3. Open the existing chat from its original sidebar entry. Observe that it fails to resume with -32602 because the Windows-native local app-server rejects the saved WSL workspace root.
  4. While the local app-server is Windows-native, create and use a new local chat with the same workspace expressed as a Windows path.
  5. Restore legacy WSL mode (runCodexInWindowsSubsystemForLinux = true) and restart with that mode retained. In my test I also prevented automatic migration from rerunning on that launch.
  6. Open both original chats. The pre-migration chat reopens, while the chat created in step 4 fails because its saved workspace root is now invalid on the Linux backend.
  7. Click the composer's Open WSL connections banner. Observe that Settings shows the SSH list and offers no WSL connection.

What is the expected behavior?

After migration and after switching back, existing chats should open and continue from their original sidebar entries, with file links resolving in the correct environment. Desktop should route a chat to a compatible backend or translate its saved workspace roots before calling thread/resume. If the migration cannot preserve access, Desktop should keep the previous mode and explain why. The banner should open a usable WSL connection screen or explain why WSL connections are unavailable.

Additional information

Selected Desktop log lines below are in UTC. Identifiers and personal paths have been replaced with placeholders, and unrelated fields have been omitted.

First launch after the update

2026-11-07T02:13:15.884Z [wsl-migration] enrollment=rollout stage=attempted
2026-11-07T02:13:16.216Z [wsl-migration] stage=completed targetDistroCount=1
2026-11-07T02:13:25.622Z [AppServerConnection] currentVersion=0.167.0 hostId=remote-wsl:Ubuntu
2026-11-07T02:14:21.940Z [AppServerConnection] conversationId=<pre-migration-chat> errorCode=-32602 method=thread/resume
2026-11-07T02:14:22.162Z [electron-message-handler] Failed to resume conversation conversationId=<pre-migration-chat>
cannot restore workspace root `/mnt/c/Users/<user>/Desktop/<workspace>` on this host: path is not absolute: /mnt/c/Users/<user>/Desktop/<workspace>. Pass `runtimeWorkspaceRoots` with valid local paths or an empty list.

After restoring legacy WSL mode

2026-11-07T03:22:43.795Z [AppServerConnection] conversationId=<windows-mode-chat> errorCode=-32602 method=thread/resume
2026-11-07T03:22:43.877Z [electron-message-handler] Failed to resume conversation conversationId=<windows-mode-chat>
cannot restore workspace root `C:\Users\<user>\Desktop\<workspace>` on this host: path is not absolute: C:\Users\<user>\Desktop\<workspace>. Pass `runtimeWorkspaceRoots` with valid local paths or an empty list.
2026-11-07T03:23:07.979Z [electron-message-handler] ownerRoutePath=/settings/connections/wsl
2026-11-07T03:29:13.889Z [AppServerConnection] conversationId=<pre-migration-chat> errorCode=null method=thread/resume

Related reports:

  • #30288: the October 5 follow-up reports the same resume error after WSL discovery fell back to Windows. In this report, the switch followed a completed automatic migration.
  • #38781: existing WSL chats fail after switching to Windows-native execution.
  • #36608: Windows-created chats retain incompatible workspace paths after switching to WSL.

Activity

  1. added
    bug
    app
    windows-os
    app-server
    on Nov 7, 2026
  2. YutoMinami commented on Nov 8, 2026

    @YutoMinami

    Same bug in the opposite direction, and I found where the value actually lives.

    The mirror case

    I'm on WSL mode (runCodexInWindowsSubsystemForLinux = true). Chats created in
    Windows-native mode
    fail to resume with the identical error:

    cannot restore workspace root C:\Users\<user>\Documents\Codex on this host:
    path is not absolute: C:\Users<user>\Documents\Codex.
    Pass runtimeWorkspaceRoots with valid local paths or an empty list.
    

    So it is symmetric: whichever mode a chat was created in, switching away from it makes
    that chat unopenable. Of my 46 threads, 31 were created in Windows mode and 15 in WSL
    mode, and only one set works at a time.

    Where the bad value comes from

    It is not .codex-global-state.json. I rewrote every Windows path in
    thread-workspace-state-v1:* (including its runtimeWorkspaceRoots),
    heartbeat-thread-permissions-by-id, thread-workspace-root-hints,
    thread-writable-roots and thread-projectless-output-directories — 75 values — and the
    app regenerated all of them on next launch. Updating threads.cwd in
    state_5.sqlite alone did not help either.

    The real source is the rollout file (~/.codex/sessions/.../rollout-*.jsonl.zst):

    session_meta.cwd                     = "C:\\Users\\<user>\\Documents\\Codex\\2026-10-27\\new-chat-2"
    session_meta.runtime_workspace_roots = ["C:\\Users\\<user>\\Documents\\Codex"]
    turn_context.cwd                     = "C:\\Users\\<user>\\Documents\\Codex\\2026-10-27\\new-chat-2"
    turn_context.sandbox_policy.writable_roots = ["C:\\Users\\<user>\\Documents\\Codex", ...]

    runtime_workspace_roots there is exactly the value the error names. The desktop state
    files are derived from this at resume time, which is why editing them is futile.

    The asymmetry that makes it a path-conversion bug

    Not all roots fail. In WSL mode:

    Stored root Resumes?
    \\wsl$\<distro>\home\<user>\<repo> yes — converted to /home/<user>/<repo>
    \\wsl.localhost\<distro>\home\<user>\<repo> yes — converted
    C:\Users\<user>\Documents\Codex\... no
    D:\<user>\Documents\<folder>\... no

    UNC WSL paths are converted; drive-letter paths are not. That looks like the same gap
    as #38781 and #42211, where /mnt/d round-trips into C:\mnt\d / C:\d\....

    Workaround that worked

    Rewriting the path-bearing structural records in the rollout restores resume. I left
    message bodies untouched so the transcript is unchanged — only these line types:

    • session_meta
    • turn_context
    • event_msg with payload.type == "thread_settings_applied"
    • world_state
    • response_item / message only when it contains <environment_context> (the
      injected block carries <workspace_roots>)

    Conversions applied to every path string in those records:

    \?\ prefix -> stripped
    \wsl$<distro>\rest / \wsl.localhost... -> /rest
    X:\rest -> /mnt/<x>/rest (lowercased drive)
    backslashes -> forward slashes
    
    PAT = re.compile(r'(?:\\\\\?\\(?:UNC\\)?)?(?:[A-Za-z]:|\\\\wsl(?:\$|\.localhost))(?:\\[^\\\n<>"\']+)+')
    
    def conv(m):
        s = m.group(0)
        if s.startswith('\\\\?\\UNC\\'): s = '\\\\' + s[len('\\\\?\\UNC\\'):]
        elif s.startswith('\\\\?\\'):    s = s[len('\\\\?\\'):]
        u = re.match(r'^\\\\(?:wsl\$|wsl\.localhost)\\[^\\]+\\(.*)$', s)
        if u: return '/' + u.group(1).replace('\\', '/')
        d = re.match(r'^([A-Za-z]):\\(.*)$', s)
        if d: return '/mnt/' + d.group(1).lower() + '/' + d.group(2).replace('\\', '/')
        return s

    Files are zstd-compressed, so decompress with zstdcat, rewrite line by line, recompress
    with zstd. I also set threads.cwd in state_5.sqlite to the matching Linux form.

    After doing this to 35 rollouts with the app closed: every previously unopenable chat
    resumes, and moving chats between projects works again.

    This is unsupported file surgery — back the files up first. It also only fixes one
    direction; the same chats would need the inverse treatment to work in Windows mode again.
    A built-in migration, or converting drive-letter roots the way UNC roots already are,
    would remove the need for any of this.

    Environment

    • Codex Desktop 26.1103.32239 (MSIX), Windows 11 10.0.26200, Ubuntu on WSL2
    • runCodexInWindowsSubsystemForLinux = true
  3. Bruno-HiFi commented on Nov 20, 2026

    @Bruno-HiFi

    Subject: Codex Desktop on Windows — Unable to migrate existing projects and chat history from legacy WSL to the new WSL connection

    Hello OpenAI Codex Support Team,

    I am using Codex Desktop on Windows 11 with Ubuntu WSL2.

    Following the deprecation of the legacy WSL agent environment, I successfully configured the new WSL: Ubuntu connection. New projects work correctly, and Codex can access both the Ubuntu filesystem and my existing project directories on the Windows C: drive.

    However, I cannot migrate my existing projects (OpenWRT, Roon, and Synology) to the new WSL connection while preserving their chat history and project associations.

    What I have tried:

    1. Created a new project using the WSL: Ubuntu connection and selected the same directory as my existing OpenWRT project.

    2. Confirmed that the new project can access the original files.

    3. Found that the new project has no previous chat history.

    4. Checked the settings of the original OpenWRT project. They allow me to manage source folders but do not provide an option to change the project's connection or execution environment to WSL.

    5. Attempted to open older conversations and encountered errors, including:

      • cannot restore workspace root ... on this host
      • Connection for host ID local not found

    After restarting Codex, some older conversations became accessible again, but the migration issue remains unresolved.

    I have backed up my Windows Codex data, including session files and automation files. I would like to avoid manually modifying SQLite databases or internal application state.

    My questions are:

    1. Is there an officially supported way to migrate existing Codex Desktop projects from the legacy WSL environment to the new WSL connection?
    2. Can I preserve the original chat history and associate it with the migrated projects?
    3. How should existing automations be migrated?
    4. Is it possible to change the connection of an existing project instead of creating a duplicate project?
    5. Will a future Codex update provide an automatic migration mechanism?

    My desired outcome is to use a single Ubuntu WSL2 environment for all my existing projects, while preserving their conversations, automations, and project configurations without creating duplicate projects.

    This issue may be related to:
    #60054

    Could you please provide the recommended migration procedure or confirm whether this functionality is currently unsupported?

    Thank you for your assistance.

  4. kami9811 commented on Nov 21, 2026

    @kami9811

    I reproduced this on Windows Desktop 26.1117.4957.0 with the bundled codex-cli 0.171.0-alpha.13 and Ubuntu on WSL. In this case the WSL migration stopped at stage=blocked. After I chose Set up later, the Desktop log recorded reason=unsupported_data. The log showed both linked and multi-folder projects, with syncedAutomations=false. I couldn’t isolate which project property triggered the block.

    17 of 17 affected chats reopened under their original IDs after the following check with the Windows app-server:

    1. I called thread/resume for each chat without overriding its workspace. All 17 calls failed with cannot restore workspace root on a saved /home/... path.
    2. I retried with the same thread ID, setting cwd and every entry in runtimeWorkspaceRoots to the corresponding existing Windows path. The saved lists included WSL filesystem roots (mapped to \\wsl$\Ubuntu\...) and, in some chats, /mnt/c/... roots (mapped to C:\...).
    3. For each chat, I started a fresh app-server process and resumed again without path overrides. All 17 returned the expected working directory and roots, and thread/turns/list returned history. The recovery used the app-server API without manually editing SQLite or rollout files.

    One additional chat showed why a successful thread/resume alone is insufficient as a regression check. It opened with a nonexistent C:\home\... working directory. After I supplied the actual \\wsl$\Ubuntu\home\... path and the corresponding roots, a fresh process resumed that same chat with the correct directory.

    A Desktop regression test could cover choosing Set up later with a saved multi-root WSL chat, reopening its original sidebar entry, restarting, and opening it again. On the second open, I’d check that the original thread ID still returns history and that the working directory and every workspace root resolve to the original folders.

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

    appapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions