[Windows][WSL][26.730.8199.0] Integrated terminal silently fails before PTY/WSL startup; bottom and side panel cannot open
What version of the Codex App are you using?
Codex Desktop from the Microsoft Store:
- Package:
OpenAI.Codex_26.730.8199.0_x64__2p2nqsd0c76g0 - App package version:
26.730.8199.0
What subscription do you have?
Not disclosed; the failure appears entirely local to the Desktop renderer/terminal lifecycle.
What platform is your computer?
- Windows 11 Enterprise x64
- OS version:
10.0.26200.8973 - WSL2
- Distribution detected by Codex: Ubuntu 26.04
What issue are you seeing?
The integrated terminal cannot be opened in Codex Desktop when the agent environment and integrated shell are configured for WSL.
All available entry points fail:
- View → Open Terminal
Ctrl+`- Toggle bottom panel
- Bottom-panel “open tab” menu → Terminal
- Side-panel “open tab” menu → Terminal
Depending on the entry point, the panel either does nothing or flashes briefly and immediately disappears. No usable terminal tab remains visible.
The same failure reproduces in:
- a projectless local task; and
- an existing folder-backed local task whose workspace is under
/home/<user>/...in WSL.
This is not a shell startup failure after the terminal UI opens. The terminal backend is never reached.
Desktop configuration
[desktop]
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"
The shipped settings schema for this build accepts wsl as a valid integrated-terminal shell.
Steps to reproduce
- Install/open Codex Desktop
26.730.8199.0on Windows 11 with WSL2. - Set Agent environment to Windows Subsystem for Linux.
- Set Integrated terminal shell to WSL.
- Open an existing local folder-backed task in a WSL project.
- Select View → Open Terminal or press
Ctrl+`. - Alternatively, open the bottom- or side-panel tab picker and choose Terminal.
- Observe that no terminal remains open. The panel may flash and immediately close.
Expected behavior
The selected panel should remain open and either:
- attach a terminal session in the active task/workspace; or
- display a visible, actionable terminal error.
It should never silently no-op or auto-collapse.
Actual behavior
- No usable terminal tab is created.
- No WSL terminal process is spawned for the action.
- No PTY module is loaded.
- No terminal-specific error is shown to the user.
- The action silently returns or the panel flashes closed.
Diagnostic evidence
1. WSL itself is healthy
From Windows, wsl.exe --status succeeds and a direct command such as:
wsl.exe -e /bin/sh -lc "pwd; printf terminal-ok"
runs successfully from the same workspace context.
Codex also launches its app-server and normal task commands inside WSL successfully. The failure is isolated to the integrated-terminal UI path.
2. Terminal action never reaches the PTY backend
While invoking the terminal through the menu and keyboard shortcut, process/module monitoring showed:
- no new
wsl.exeprocess attributable to the terminal action; - no
pty.node,conpty.node, orwinptymodule loaded by any Codex/ChatGPT process; - the packaged
node-ptyand ConPTY assets are present on disk; - no Microsoft Defender block or quarantine event.
The app log contains no terminal/PTY creation error around the action. This is consistent with a renderer guard returning before terminal creation.
3. The shipped renderer contains a route/thread-ID mismatch
Inspection of the shipped Desktop renderer bundle shows that the route parser produces an existing local-thread route containing conversationId:
{
routeKind: "local-thread",
conversationId,
hostId,
projectContext,
...
}
However, the integrated-terminal target resolver uses clientThreadId for that route and returns null for a client-local route. Equivalent pseudocode:
function resolveTerminalTarget(scope) {
switch (scope.value.routeKind) {
case "home":
return target(scope.value.clientThreadId);
case "local-thread":
return {
conversationId: scope.value.clientThreadId, // undefined on this route
conversationTitle: getTitle(scope.value.conversationId),
cwd: getCwd(),
hostId: getHostId(),
};
case "client-local-thread":
return null;
default:
return null;
}
}
For an existing local-thread, the terminal target therefore receives an undefined conversation ID.
The terminal wrapper then treats a null/undefined conversation ID as having no conversation snapshot and returns without rendering the actual TerminalPanel. As a result, the effect that calls the terminal host service never runs, which explains all observed evidence:
- no terminal tab/content;
- no PTY load;
- no
wsl.exespawn; - no backend error.
4. The global terminal-command fallback also lacks route scope
The global toggleTerminal fallback invokes the windows.terminal.toggle app action without an action context:
toggleTerminal = () => {
runAppAction({
type: "windows.terminal.toggle",
windowId: "current",
});
};
But the registered action requires a route scope before calling the terminal toggle:
run: (_action, context) => {
toggleTerminal(requireRouteScope(context));
}
The fallback does not await or handle the rejected promise. When the route-specific handler is inactive, View → Open Terminal / the shortcut therefore becomes a silent no-op instead of surfacing “App action requires a route scope”.
Why this appears to be a Desktop routing/session-ownership regression
The public issue history already contains the same user-visible failure and a closely matching thread-owner analysis:
- #26950 — Windows terminal flashes and immediately closes
- #25256 — Windows bottom panel flashes and disappears
- #29090 — bottom and side terminal panel fail similarly
- #31417 — terminal snapshot lookup misses sessions because temporary/permanent thread ownership IDs diverge
- #28141, especially issue comment 4953033965 — shipped-renderer analysis of
client-local-threadreturning null and terminal sessions being indexed byclientThreadId
A user reported that the macOS behavior in #28141 was fixed in Desktop 26.721.41059. However, Windows package 26.730.8199.0 still reproduces the failure, and its shipped renderer still contains the problematic resolver/fallback control flow. This may be a Windows packaging gap or a regression/reintroduction.
Suggested fix
- Return a valid terminal target for both
local-threadandclient-local-thread. - Resolve the correct canonical/aliased client thread ID instead of reading a field that is absent from the local route.
- Use the same alias-aware conversation key for:
- terminal session storage;
- terminal panel rendering;
- terminal snapshot/read lookup.
- Pass the active route scope to the global
windows.terminal.toggleaction, or route the command through the mounted route-specific handler. - Await/log failures from terminal toggle actions.
- Keep the panel visible with a loading or error state if terminal attachment fails.
Regression coverage
- Existing folder-backed local thread: terminal opens and accepts input.
- Projectless local thread: terminal opens and accepts input.
client-local-thread→ permanentlocal-threadmaterialization: the same terminal session remains attached.- View menu, keyboard shortcut, bottom-panel picker, and side-panel picker all reach the same working terminal action.
- Forced PTY failure: panel stays visible with an actionable error.
- Windows + WSL: opening the terminal results in an observable PTY/WSL process and a registered terminal session.
Additional information
No private task IDs, user paths, or raw logs are included here. A sanitized log excerpt or feedback/session ID can be supplied if maintainers request it.
22 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Not, This is Windows Case
Additional confirmation after explicitly changing the integrated terminal shell to WSL and fully restarting Codex Desktop.
Environment:
10.0.26200.8973OpenAI.Codex_26.730.8199.0_x64__2p2nqsd0c76g0Ubuntu-22.04codex-cli 0.146.0Effective configuration after restart:
The result is unchanged: opening the terminal/bottom panel briefly shows the panel and it immediately closes. The same symptom previously reproduced with
integratedTerminalShell = "powershell", so the selected terminal shell is not the trigger.Fresh startup diagnostics show that the WSL agent path itself is healthy:
Ubuntu-22.04.wsl.exe.codex --versionandgit statusboth succeed.After attempting to open the integrated terminal, persisted UI state for the active task still contains no terminal route or session:
The fresh Desktop log contains only successful
thread/backgroundTerminals/cleanrequests for this task. There is no terminal-create request, PTY startup, WSL terminal spawn, or terminal-specific backend error around the action. This supports the renderer/route early-return diagnosis in this issue: the UI collapses before the terminal host is reached.Two additional startup warnings remain on this build:
However,
/usr/bin/bwrapis installed and functional in WSL, Codex's previously relocatedcodex-resources/bwrapis also present and executable, and Git works normally inside WSL. These warnings appear to be separate Windows/WSL packaging and Git-worker regressions rather than an explanation for the terminal action never reaching PTY creation.Changing the shell, repairing/resetting local startup state, updating the WSL CLI, and restarting Desktop do not resolve the terminal failure. A fix appears to require the Desktop renderer/session-routing changes described in the issue body.
On Codex Desktop
26.730.8199.0, I found two stacked failures in the Windows/WSL integrated-terminal path. First, the renderer loses terminal ownership when a temporary client thread becomes a persisted local thread. After correcting that lookup, terminal creation reaches the main process but still aborts beforenode-ptystarts because an optional Git/worktree-environment lookup throwsGit is unavailable. That fatal host error removes the terminal snapshot, so the renderer immediately closes the tab and panel—the brief flash users see.How I isolated it
wsl.exe, Windows Git, WSL/usr/bin/git, and a direct shell in the same repository all work.app.asarremained unchanged.host-event type=error message="Git is unavailable"; no PTY had spawned.getWorktreeRepository(...)callback used while building the terminal environment. Terminal creation treats that callback failure as fatal, removes the session snapshot, and the UI reconciler closes the panel.The important main-process fallback is:
The complete workaround also applies the renderer route/thread-alias fixes described in the issue body and normalizes a bare
wsl.exelaunch whose CWD is a WSL UNC path.Temporary workaround for other users
Start-Codex-Terminal-Fix.ps1in that same directory:<details>
<summary>PowerShell launcher</summary>
</details>
terminal-route-shim.logshould containmain_module_patched,renderer_patched,terminal_pty_spawn, a host event with"type":"attached", andterminal_pty_first_output.With the workaround, I successfully opened two WSL terminals. Before it, every attempt ended with
Git is unavailablebefore PTY creation.To remove it, fully quit Codex and launch the normal Start-menu shortcut instead. No reinstall or package repair is needed. After any Codex update, stop using this launcher and test the stock app first; the launcher rejects other versions and the shim also checks the exact bundled-file hashes. The diagnostic log can contain local paths, so redact it before sharing.
For the product fix, worktree-shell-environment lookup should be best-effort, the renderer should use alias-aware terminal ownership consistently, and terminal-host failures should remain visible instead of collapsing the panel.
Still reproducible in Windows package 26.803.5235.0.
Environment:
I have the same problem in Windows app version 26.803.41515. This had been working perfectly up until the few days, so I suspect the feature was broken in a recent update.
Still reproducible in windows package 26.803.81509
Environment:
Updated behavior on Codex Desktop for Windows
26.803.10989.0.The original renderer early-return failure appears to have progressed further in this build: with Agent environment set to WSL and integrated terminal shell set to WSL, opening the terminal now causes
ChatGPT.exeto spawn a realwsl.exechild. However, the child survives for only about 39 ms, exits, and the terminal panel immediately collapses.Controlled comparisons:
wsl.exe -d Ubuntufrom the exact same WSL UNC workspace succeeds, enters the expected/home/<wsl-user>directory, and exits 0.This narrows the remaining failure to the WSL-Agent-specific terminal host / PTY / session-attachment path rather than WSL itself, UNC cwd translation, or the WSL terminal-shell selection.
I captured the parent/child relationship and lifetime, but not the short-lived child's full command line or exit code. Therefore this is evidence for the failure boundary, not a claim about the final internal exception. It is also a useful regression distinction from
26.730.8199.0, where prior diagnostics showed the terminal action could fail before a WSL/PTY child was created.Expected behavior remains: terminal-host failures should retain a visible tab with an actionable error, and Windows-Agent/WSL-Agent terminal launch should use the same validated WSL cwd and shell-launch path.
Follow-up after inspecting the current package and comparing the legacy and remote WSL terminal paths.
Environment/version clarification:
OpenAI.Codex_26.803.10989.0_x64__2p2nqsd0c76g026.803.81509/home/<wsl-user>localThe important additional distinction is that
runCodexInWindowsSubsystemForLinux = truenow selects the deprecated legacy WSL agent environment, not the newer WSL-connection host architecture. The current package contains UI text directing legacy users to open a project from a WSL connection instead, and it contains a dedicated WSL remote host/terminal backend. A WSL remote host would have an identity such asremote-wsl:<distro>and would start the POSIX terminal session inside that host.This affected task is still
hostId=local, and noremote-wsl:Ubuntuproject/connection is exposed in the current client state.For the legacy local-host route, the Linux cwd is normalized to a WSL UNC path (conceptually
\\wsl$\Ubuntu\home\<wsl-user>) and then used by the Windows-local PTY/ConPTY launch path. In the controlled Windows-agent case, Linux-path conversion is not active: the local terminal launcher falls back to a safe Windows cwd, startswsl.exe, and then initializes the shell cwd inside WSL. That route remains stable.This refines the earlier 39 ms observation:
wsl.exeis spawned byChatGPT.exe, exits after about 39 ms, and the panel collapseswsl.exe -d Ubuntuand normal WSL agent commands workA correction to my previous comment: saying the comparison ruled out "UNC cwd translation" was too broad. The direct WSL command proves WSL itself is healthy, but it does not prove that the Windows-local node-pty/ConPTY launch path handles the same WSL UNC cwd and legacy session initialization correctly. The failing boundary is the combination of legacy WSL-agent cwd normalization, the local PTY backend, and terminal session attachment; UNC syntax by itself has not been isolated as the sole cause.
The Desktop log still does not retain a terminal-specific backend error. After the panel flashes closed, the task reports that no app terminal session is attached. The renderer also emits a burst of
ResizeObserver loop completed with undelivered notificationsmessages while the panel opens/collapses, but those look like UI fallout and are not sufficient to identify the backend exception.Suggested product-side handling:
remote-wsl:<distro>project before removing or hiding the old route./home/<user>/...in both:No raw logs, task IDs, usernames, or private paths are included here.
Additional confirmed trace for Codex App
26.803.81509/ Store package26.803.10989.0is documented in #37962.codexHomeas a Windows UNC path while selecting the POSIX path parser..and invokeswsl.exe --cd ., which returnsWsl/E_INVALIDARGbefore the shell or Git starts.Git is unavailablerejection escapes the optional worktree-environment lookup, deletes the terminal session, and triggers renderer cleanup beforenode-pty.spawn.--cd .fails; changing only the cwd to--cd /makes the unchanged Git probe succeed.The underlying Git-probe regression is tracked in #35119. Related symptom reports are #37821 and #37771.
Confirming — still broken on my machine (2026-08-12)
Environment
26.803.10989.0Symptom
Click Terminal → panel flashes / closes immediately → no usable terminal tab.
Checks
Please prioritize: optional Git probe failure should not kill the integrated terminal.
Related: #35119
Still reproducible as of 2026-08-18 on Codex App
26.810.7004.0from the Microsoft Store.My setup is Windows 11 with WSL2 and Ubuntu 24.04, with:
Clicking the terminal button still makes the panel appear briefly and immediately close, leaving no usable terminal session. WSL and Git continue to work normally outside Codex. Selecting PowerShell as the integrated terminal does not help while the Codex agent environment remains set to WSL.
The Store currently reports that the app is fully up to date. The detailed trace from this machine is documented in #37962.
Confirmed on current Windows package 26.814.5167.0 — root cause isolated and locally patched successfully.
Environment:
Windows 11 x64
WSL2 / Ubuntu
Codex package: OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0
Agent runtime: WSL
Integrated terminal shell: WSL
Reproduction:
With Agent runtime = Windows, both PowerShell and WSL terminals work.
With Agent runtime = WSL, both PowerShell and WSL terminal options cause the bottom terminal panel to flash and immediately close.
I instrumented the shipped 26.814.5167.0 renderer and terminal session manager.
The immediate panel close is only cleanup. The actual failure is a terminal-host error:
Git is unavailable
The renderer receives the terminal error event, calls deleteSessionMapping(sessionId), the terminal session disappears from the conversation snapshot, and the bottom-panel cleanup then removes the terminal tab and closes the empty panel.
Importantly, Git itself is available inside the WSL terminal:
DISTRO=Ubuntu
/usr/bin/git
git version 2.43.0
I isolated the failing call in the main-process Terminal Manager initialization. The terminal receives a getWorktreeShellEnvironmentForCwd callback equivalent to:
async t => {
let r = await e.gitManager.getWorktreeRepository(n.ho(t), s);
return r == null ? null : n.X(r);
}
When getWorktreeRepository() throws Git is unavailable, this optional Git/worktree environment lookup aborts terminal creation.
I changed only this callback to fail open:
async t => {
try {
return (t = await e.gitManager.getWorktreeRepository(n.ho(t), s)) && n.X(t);
} catch {}
}
No renderer cleanup changes, routing changes, or terminal-session hacks are required.
After applying only this change to the original 26.814.5167.0 ASAR:
WSL Agent runtime works
integrated WSL terminal stays open
PTY is actually running inside Ubuntu/WSL2
uname, pwd, filesystem operations and /usr/bin/git all work normally
So for this reproduction, the terminal is being killed by an optional Git/worktree shell-environment lookup that throws instead of degrading to null.
This may also be related to #35119 (Git is unavailable in valid WSL repositories) and the older symptom report #25256.
A likely upstream fix is to make getWorktreeShellEnvironmentForCwd fail-open when Git/worktree detection is unavailable, rather than failing terminal creation.
Still reproducible on 2026-08-20 with the newer Windows Store package:
OpenAI.Codex_26.814.5517.0_x64__2p2nqsd0c76g010.0.262006.6.87.2-microsoft-standard-WSL2codex-cli 0.146.0git version 2.43.0This reproduction is useful because the affected folder-backed task is running through the current managed WSL connection route (
remote-ssh-codex-managed:wsl), not the deprecated legacyhostId=localWSL-agent route discussed above.The persisted desktop settings are also different from the original report:
The task itself still executes normally inside WSL and its app-server connection is healthy. However, on the existing session page:
Ctrl+` is a silent no-op;No app terminal session is attached to this thread yet.;The Microsoft Store reports that no newer package is available.
So the terminal/session-attachment failure is still present in
26.814.5517.0, and it can also reproduce on the managed WSL connection path. This trace does not establish whether the optional Git/worktree-environment failure identified in the previous comment is the trigger here; the directly verified boundary is that no app terminal session becomes attached.Still reproducible as of 2026-08-21 after updating Codex from
26.810.7004.0to26.818.31338.The configuration on the same Windows 11 / WSL2 / Ubuntu 24.04 machine remains:
After the update, clicking the terminal button still makes the panel flash briefly and close immediately without leaving a usable terminal session. WSL and Git continue to work normally outside the Codex integrated terminal, so the update has not resolved the issue on this machine.
I too am getting this issue with the terminal flash and close immediately. No error message no way to triage, troubleshoot, or correct. I am trying WSL2 with Ubuntu 26 distro. Hasn't worked for a few weeks now - very buggy and poor UX.
Tried both side and bottom panels. Side panel if I open Files it works, then when I try to add terminal, the brief flash and disappear when I try to add it.
Codex Windows App Version: 26.818.31338 (updated just before this post was made)
Current Store build
26.818.5229.0: terminal Git-enrichment path remains unguardedCross-linking #37962 with evidence from a newer installed package.
I inspected an isolated copy of
OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0(app.asarSHA-256C5D839BC9B122B7EF2A2F0F45186B3E5895923DE5B6CEF5253C936FE670C0479). The terminal manager still contains one unguarded callback equivalent to:If the Git worker rejects with
Git is unavailable, this optional environment-enrichment step can still abort terminal creation before PTY startup.An isolated, byte-length-preserving A/B patch changed only that callback to catch the repository lookup and return
null. Validation on the exact runtime matched one terminal site, preserved the ASAR byte length, and allowed terminal creation to proceed without Git enrichment. This is diagnostic confirmation; users should not need to patch a copied Store runtime.The production behavior should be a normal error boundary with logging:
The Git probe itself must also be fixed, but Git capability detection and terminal availability are separate concerns: failure of the former must never silently destroy the latter.
The complete failure chain, impact assessment, clean fix, and regression-test proposal are documented here: https://github.com/openai/codex/issues/37962#issuecomment-5391032851
Please link the internal fix/owner and identify the first Microsoft Store build expected to contain the terminal failure-isolation change.
I can reproduce the same silent no-op on a Windows-native local folder-backed task (not a WSL project) with Microsoft Store package
OpenAI.Codex_26.818.5345.0_x64__2p2nqsd0c76g0.All entry points fail:
No panel or terminal session is created; the app reports that no terminal session is attached to the thread. External Windows Terminal and PowerShell work normally, and
npm run devruns successfully there.I reproduced this after:
26.818.5229.0to26.818.5345.0The app log repeatedly emits:
ResizeObserver loop completed with undelivered notifications.This suggests the route/thread-scope regression described in this issue also affects Windows-native existing local-thread routes, not only WSL-configured tasks. No private paths, task IDs, account IDs, or raw logs are included.
This problem is still reproducible in version 26.818.61809 (just updated this morning).
Still reproducible on Microsoft Store package 26.818.8289.0.
Additional finding: the trigger appears to be the Agent Environment setting, not only the integrated terminal shell.
Test matrix:
The app was fully restarted and a new thread was created after changing the settings.
WSL itself is healthy:
This suggests runCodexInWindowsSubsystemForLinux=true prevents integrated terminal session creation regardless of integratedTerminalShell.
Codex feedback session ID: 01a03697-defc-7d72-b2f4-d1014e2b558f
Why did you close, @cxzhong ? Did you find a fix?
The lastest version fixes this