You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom pets fail to load in WSL environments due to path normalization #20730
Custom Pets appear to not work in WSL-enabled environments. This may be caused by Windows/WSL path normalization for the custom pets directory.
Environment
Windows host with WSL-enabled Codex environment
Custom Pets enabled/configured
Observed behavior
Custom Pets do not load correctly when running Codex from a WSL-enabled environment.
The suspected problem is that Codex is resolving or normalizing the custom pet asset path incorrectly instead of looking under the expected \pets path.
Expected behavior
Custom Pets should work in WSL-enabled environments. Codex should normalize/translate the custom pet path consistently between the Windows host and WSL/Linux runtime so the configured pet assets can be located.
Possible cause
Path normalization between Windows host paths and WSL/Linux paths may be incomplete for custom pet assets. The custom pet lookup may need to normalize to the expected pets directory before attempting to load pet assets.
Notes
This issue is specifically about Custom Pets failing in WSL-enabled environments. A previous local screenshot read error was unrelated to the underlying Custom Pets behavior and has been removed from this report.
Reacted by abrory, bkntr, randomguy, Benyomin Mandel, RealDragounov, TimeOfAnarchy, xlwang2001, Ryan, Nicholas Chae, Vi Minh Hiếu and 22 more
Repro: custom pet clawd is present under ~/.codex/pets/clawd/{pet.json,spritesheet.webp} and appears normally when Codex is used from Windows native, but it does not appear in Settings when Codex is run from a WSL2 environment.
Observed with Codex 26.429.30905 on @OpenAi.
Plan: Business Plan
Platform: Windows
This matches the path-loading behavior described in this issue.
Codex notes that the package validates locally per the hatch pet skill: pet.json points to spritesheet.webp, and the spritesheet is a valid 1536x1872 WebP. The app Settings UI shows the custom pets folder as C:\Users\username\.codex\pets, but after Refresh and app/PC restart, the custom pet still does not appear.
This should be scoped to custom pet/avatar discovery and should not change global CODEX_HOME, app-server launch behavior, terminal command execution, workspace paths, skills, agents, or file browsing helpers
Reacted by imi, momean, RealDragounov, xlwang2001, 今夕是何年, 1157261129, Xing Rong and NERDHEAD
I can add one data point from a newer Windows build. This does not establish a new root cause, but it narrows the behavior a bit: the UI can open the expected custom pets folder, while the custom pet list/renderer still does not pick up valid packages from that same folder.
CODEX_HOME in the WSL app-server process resolves to the WSL view of the Windows Codex home
WSLENV includes CODEX_HOME/p
Note: this is not a clean-install environment. It is a real Windows + WSL Codex Desktop profile that has previously had Desktop/WSL path and local history troubleshooting. I am including this because the issue still reproduces after that profile is in a stable state where local history opens correctly.
Additional observation
In Settings > Appearance > Pets, the custom pets Open folder action opens the expected folder:
<CODEX_HOME_WIN>\pets
That folder contains multiple valid custom pet packages.
After clicking Refresh custom pets, no custom pets appear in the Pets list.
Setting selected-avatar-id to a custom pet folder id, for example custom-pet-02, is persisted in .codex-global-state.json.
Running Wake Pet or /pet still shows the built-in codex pet, so the renderer appears to fall back after failing to resolve/list/load the selected custom pet.
Local package validation
I tested three packages under <CODEX_HOME_WIN>\pets:
custom-pet-01
custom-pet-02
custom-pet-03
For each package:
pet.json exists.
spritesheet.webp exists.
pet.json.id matches the folder name.
pet.json.spritesheetPath points to the existing spritesheet.webp.
Earlier comments already show that custom pets work in Windows native mode but not in WSL mode, and one comment points to a mixed path such as C:\Users\<USER>\.codex/pets.
This newer-build data point suggests there may be two separately visible paths in the UI:
The Open folder path resolves correctly to <CODEX_HOME_WIN>\pets.
The refresh/list/load path still fails to discover the same valid packages and falls back to the built-in pet.
So the failing path may be specifically in the custom pet scan/list/load code path rather than in the folder-opening helper.
I can confirm this is still reproducible in Codex Desktop on Windows.
In Settings > Appearance, the Custom Pets location is displayed with mixed path separators:
C:\Users\<user>\.codex/pets
The expected Windows path display would be:
C:\Users\<user>\.codex\pets
Or, if this path is being passed to the renderer for asset loading, it likely needs to be converted to a proper file URL first, e.g.:
file:///C:/Users/<user>/.codex/pets/...
This looks like the pets directory is being constructed with a hardcoded POSIX suffix, such as appending /pets to a Windows %USERPROFILE%\.codex path, instead of using platform-aware path joining and URL conversion. Custom pets are discovered/shown in the UI, but the mixed root path appears consistent with the load failure.
Reacted by 今夕是何年, fbernklau, Ji Xiangyu, 1157261129, tradew1nd, yyl123456, Kevin and weihao.li
Despite this, refreshing custom pets in Windows Codex Desktop while the app-server is running through WSL does not make the custom pet available/loadable. The built-in pet remains the only usable pet.
This confirms the problem is still present in Desktop 26.715.3651.0; it is not caused by a missing package or Windows/WSL copies being out of sync. It remains consistent with the WSL custom-pet discovery/path-normalization failure described in this issue.
Reproduced on Codex Desktop 26.715.4045.0 on Windows with the Codex app server running in WSL.
I had 37 valid custom pet packages under %USERPROFILE%\.codex\pets. Settings showed built-in pets only, with no error. The failure was caused by custom-pet discovery combining a Windows CODEX_HOME path (C:\...) with POSIX path operations from the WSL app server; the resulting mixed path fails and the loader silently returns an empty custom-pet list.
A user-local patched copy that normalizes the Windows drive path to /mnt/c/... before joining the pets directory loaded all 37 pets successfully, including Zoro, Obito, and Sasuke. Selecting pets then worked normally.
One extra detail: a separate patched desktop executable must be launched only after fully exiting stock Codex, otherwise the app's single-instance handoff reopens the unpatched WindowsApps build.
Still reproducible in Codex Desktop 26.715.10079.0 on Windows with a WSL-backed agent environment. A valid v1 pet at C:\Users<USER>.codex\pets\jimothy passes the app’s manifest, dimensions, and WebP parser checks, but Custom pets remains empty after refresh and full restart. Mirroring it to /home//.codex/pets/jimothy does not help. This appears to confirm the mixed Windows/POSIX path-normalization bug described here. Please prioritize a fix.
Refresh and full process restart do not list or activate the pet
Creating/loading additional custom pets is affected as well
The proposed Windows-side selection workaround was also tested:
selected-avatar-id = "custom:pearl1"
The selection persists, but the pet still cannot be resolved or rendered.
Current-build inspection
The packaged desktop code calls the custom-avatar loader with behavior equivalent to:
load({preferWsl: !!process.env.WSL_DISTRO_NAME})
The Electron host is a Windows process, so WSL_DISTRO_NAME is not set even though the configured agent environment is WSL. Consequently, preferWsl is false and Codex home resolves as a Windows path. The loader then obtains the WSL/POSIX platform path implementation and joins that Windows home with pets, producing a mixed path such as:
C:\Users\<USER>\.codex/pets
This explains why placing identical packages in both the Windows and WSL homes, refreshing, restarting, and directly selecting custom:pearl1 all fail: list and load use the same incorrect resolution boundary.
Could a maintainer please:
Confirm ownership or planned status for this regression.
Derive preferWsl from the Desktop WSL setting (or normalize the Codex home specifically in custom pet/avatar discovery) rather than the Windows Electron process environment.
Add a Windows-host/WSL-app-server integration test for custom pet list and load.
Post continuing updates here when the issue is triaged, assigned, fixed, or available in a test/release build.
This has now been reproduced across multiple 26.721 builds and prevents all custom-pet use for users who need to retain WSL for their development environment.
Desktop logs confirm the local app-server is started with spawnCommand=wsl.exe
Windows Codex home: C:\Users\<USER>\.codex
WSL sees that home as /mnt/c/Users/<USER>/.codex
Pet packages tested
Two v2 packages were installed in both the Windows Codex home and the WSL user home:
satoru-gojo
sasuke
For both packages:
pet.json parses successfully
spritesheetPath resolves to the existing spritesheet.webp
spriteVersionNumber is 2
the packaged app's own WebP parser recognizes the VP8L data as exactly 1536x2288
the same acceptance predicate used by the 26.721.4979.0 loader returns true
Despite this, Settings > Pets > Refresh does not list either custom pet. Mirroring the packages under /home/<USER>/.codex/pets does not help.
Loader finding
The current package does not use a separate pet registry. It enumerates CODEX_HOME/pets/*/pet.json directly. The main-process service calls the loader with behavior equivalent to:
The Windows Electron process does not reliably expose the configured Desktop WSL mode through process.env.WSL_DISTRO_NAME, while executionHostRegistry.get() is backed by the WSL/POSIX app-server host. The loader can therefore join a Windows home with a POSIX path implementation and construct:
C:\Users\<USER>\.codex/pets
One additional reason this is difficult to diagnose from logs: the loader wraps creation/access of the computed pets directory in a broad try/catch; on failure it returns { avatarDirectory, avatars: [] }. Individual manifest/load failures are also caught and returned as null, so Refresh can silently show an empty custom-pet list even though both packages validate.
This independently confirms the 26.721 mixed Windows/POSIX resolution boundary. Deriving the pet loader's path flavor from the selected execution host/Desktop WSL setting, rather than the Electron process environment, should address both list and load.
I found and locally validated a non-patched, reversible workaround for users who need to keep Codex Desktop's agent environment set to WSL. It uses the stock Microsoft Store package: no ASAR changes, unsigned executable, package replacement, or pet-file duplication.
Validated on OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0. Both custom-pet listing and loading worked through the workaround.
Why it works
The current loader effectively combines a Windows CODEX_HOME with the WSL/POSIX path implementation. Giving the Windows Electron process a POSIX-form CODEX_HOME avoids that mixed path. Two NTFS directory junctions make the same alias resolvable from both sides:
A junction beside the real Windows .codex makes /mnt/<drive>/.../.codex-wsl-pets-shim work inside WSL.
A second junction under the app drive's \mnt\... tree handles Windows-side Node calls that interpret /mnt/... as a root-relative Windows path.
The WSL app-server itself remains on the real shared Codex home, preventing config/auth/session state from splitting between Windows and WSL.
Important assumptions and cautions
The scripts derive the Windows username, profile location, profile drive, and current Codex package location automatically.
They assume the normal WSL drive mount root, /mnt. If automount.root was customized in /etc/wsl.conf, change $wslMountRoot in every block below.
The setup refuses to replace any existing non-matching path.
Do not replace or delete the real %USERPROFILE%\.codex directory.
Do not globally set WSL_DISTRO_NAME or globally set Windows CODEX_HOME to the POSIX alias.
1. Create the two aliases once
Run this in Windows PowerShell:
$ErrorActionPreference='Stop'$wslMountRoot='/mnt'# Change only if WSL automount.root is customized.$wslMountRoot=$wslMountRoot.TrimEnd('/')
$package=Get-AppxPackage OpenAI.Codex |Sort-Object Version -Descending |Select-Object-First 1if ($null-eq$package) {
throw'The OpenAI.Codex Appx package was not found for this Windows user.'
}
$realHome=Join-Path$env:USERPROFILE'.codex'if (-not (Test-Path-LiteralPath $realHome-PathType Container)) {
throw"Codex home does not exist: $realHome"
}
$profileRoot= [IO.Path]::GetPathRoot($env:USERPROFILE)
$profileDrive=$profileRoot.Substring(0,1).ToLowerInvariant()
$relativeProfile=$env:USERPROFILE.Substring($profileRoot.Length).Replace('\','/')
$wslRealHome="$wslMountRoot/$profileDrive/$relativeProfile/.codex"$wslShim="$wslRealHome-wsl-pets-shim"$userShim="$realHome-wsl-pets-shim"# A Windows process resolves a leading / against its current drive. The launcher# below uses the package directory as its working directory, so mirror the# POSIX-looking alias under that drive as well.$appDriveRoot= [IO.Path]::GetPathRoot($package.InstallLocation)
$windowsShim=Join-Path$appDriveRoot ($wslShim.TrimStart('/').Replace('/','\'))
functionEnsure-Junction {
param([string]$Path, [string]$Target)
$item=Get-Item-LiteralPath $Path-Force -ErrorAction SilentlyContinue
if ($null-ne$item) {
$targets=@($item.Target) |ForEach-Object { ([string]$_).TrimEnd('\') }
if (($item.LinkType-ne'Junction') -or
($targets-notcontains$Target.TrimEnd('\'))) {
throw"Refusing to replace existing path: $Path"
}
Write-Host"Already correct: $Path -> $Target"return
}
New-Item-ItemType Directory -Force -Path (Split-Path-Parent $Path) |Out-NullNew-Item-ItemType Junction -Path $Path-Target $Target|Out-NullWrite-Host"Created: $Path -> $Target"
}
Ensure-Junction -Path $userShim-Target $realHome
Ensure-Junction -Path $windowsShim-Target $realHomeWrite-Host''Write-Host'In the WSL distro used by Codex, add this to its login-shell profile:'Write-Host"export CODEX_HOME='$wslRealHome'"Write-Host''Write-Host"Per-launch Windows CODEX_HOME will be: $wslShim"
Directory junctions normally do not require Developer Mode. If creating the parent under the app drive fails with Access denied, rerun this one-time setup in an elevated PowerShell window.
2. Keep the WSL app-server on the real shared home
In the same WSL distro Codex Desktop uses, add the export CODEX_HOME=... line printed by the setup script to the active login-shell profile.
Use the exact line printed for the machine; the example above is only illustrative. If ~/.bash_profile exists, add it there instead or make it source ~/.profile.
This step matters because Desktop launches the WSL app-server through a login shell. It ensures the WSL process continues using the real Windows-backed Codex home for configuration, authentication, sessions, skills, and pets, while only Electron sees the alias.
3. Launch the stock app with the per-process alias
Fully quit Codex Desktop first, including its tray/background process. Because Desktop is single-instance, launching while an old process remains will hand off to that process and ignore the new environment.
Save the following as, for example, Start-Codex-WslPets.ps1, or paste it into PowerShell whenever starting Codex:
$ErrorActionPreference='Stop'$wslMountRoot='/mnt'# Must match the setup script.$wslMountRoot=$wslMountRoot.TrimEnd('/')
if (Get-Process ChatGPT -ErrorAction SilentlyContinue) {
throw'Quit Codex Desktop completely, including its tray process, then rerun.'
}
$package=Get-AppxPackage OpenAI.Codex |Sort-Object Version -Descending |Select-Object-First 1if ($null-eq$package) {
throw'The OpenAI.Codex Appx package was not found.'
}
$profileRoot= [IO.Path]::GetPathRoot($env:USERPROFILE)
$profileDrive=$profileRoot.Substring(0,1).ToLowerInvariant()
$relativeProfile=$env:USERPROFILE.Substring($profileRoot.Length).Replace('\','/')
$env:CODEX_HOME="$wslMountRoot/$profileDrive/$relativeProfile/.codex-wsl-pets-shim"$exe=Join-Path$package.InstallLocation'app\ChatGPT.exe'if (-not (Test-Path-LiteralPath $exe)) {
throw"Codex executable was not found at: $exe"
}
Start-Process-FilePath $exe-WorkingDirectory (Split-Path-Parent $exe)
This launcher discovers the current installed package path, so normal updates on the same app drive do not require hard-coding a versioned WindowsApps directory.
After launch, leave the agent environment set to WSL, then open Settings → Pets and click Refresh custom pets. Existing custom pets under the real %USERPROFILE%\.codex\pets should appear; no copy under /home/<wsl-user>/.codex/pets is needed.
The launcher must be used after each complete exit while the affected build is installed. It changes only the child process environment and does not set a permanent Windows environment variable.
Rollback
Fully quit Codex. Run the following in PowerShell; it verifies both paths are junctions targeting the real .codex before removing them:
$ErrorActionPreference='Stop'$wslMountRoot='/mnt'# Must match setup.$wslMountRoot=$wslMountRoot.TrimEnd('/')
$package=Get-AppxPackage OpenAI.Codex |Sort-Object Version -Descending |Select-Object-First 1$realHome=Join-Path$env:USERPROFILE'.codex'$userShim="$realHome-wsl-pets-shim"$profileRoot= [IO.Path]::GetPathRoot($env:USERPROFILE)
$profileDrive=$profileRoot.Substring(0,1).ToLowerInvariant()
$relativeProfile=$env:USERPROFILE.Substring($profileRoot.Length).Replace('\','/')
$wslShim="$wslMountRoot/$profileDrive/$relativeProfile/.codex-wsl-pets-shim"$appDriveRoot= [IO.Path]::GetPathRoot($package.InstallLocation)
$windowsShim=Join-Path$appDriveRoot ($wslShim.TrimStart('/').Replace('/','\'))
foreach ($shimin@($userShim,$windowsShim)) {
$item=Get-Item-LiteralPath $shim-Force -ErrorAction SilentlyContinue
if ($null-eq$item) {
continue
}
$targets=@($item.Target) |ForEach-Object { ([string]$_).TrimEnd('\') }
if (($item.LinkType-ne'Junction') -or
($targets-notcontains$realHome.TrimEnd('\'))) {
throw"Refusing to remove non-matching path: $shim"
}
&$env:ComSpec/d /c "rmdir `"$shim`""if ($LASTEXITCODE-ne0) {
throw"Failed to remove junction: $shim"
}
Write-Host"Removed junction: $shim"
}
rmdir removes only these two ...-wsl-pets-shim junctions, not their target or any pet/config/session data. The WSL profile's real CODEX_HOME export can remain; remove that line only if Windows and WSL should no longer share a Codex home.
After a Codex update, first try launching normally. If custom pets work with WSL without this launcher, roll back the aliases and delete the launcher.
The two copies have matching SHA-256 hashes. The spritesheet passes the current Hatch Pet validator:
WebP / RGBA
1536x1872
zero validation errors and warnings
pet.json.spritesheetPath resolves to the existing file
After Refresh, full tray exit, and restart, Desktop still renders the built-in default pet instead of the selected custom pet.
Runtime evidence
Immediately after the avatarOverlay window starts, the Desktop log records:
method=fs/readFile
error={"code":-32603,"message":"No such file or directory (os error 2)"}
rendererWindowAppearance=avatarOverlay
The packaged loader in this build still appears to select WSL preference using behavior equivalent to:
preferWsl: !!process.env.WSL_DISTRO_NAME
while the Electron host is a Windows process and the execution host is the WSL/POSIX app-server. This remains consistent with the mixed Windows/POSIX custom-pet path described in this issue.
This also looks like a regression or incomplete fix relative to #21471, which was closed as completed. Could the team please re-check custom pet discovery/loading with WSL-backed Desktop on the current 26.727 release line?
Additional failure mode on 26.727.6591.0: "Create your own pet" fails, and the trigger is the spelling of CODEX_HOME
Following up on my earlier comment. This is a distinct symptom from the list/render failures reported so far, and it isolates the boundary to a single condition.
Desktop log confirms the app-server is launched with spawnCommand=wsl.exe
Symptom
Settings > Pets > Create your own pet appears inert. Clicking it produces only the Unable to start pet creation toast, so it reads as a dead button. The Desktop log shows the
real failure, once per click:
warning [electron-fetch-handler] Failed to install recommended skill
error="EPERM: operation not permitted, mkdir '\\wsl$\Ubuntu-24.04\Program Files'"
Because the UI calls the installer with forceReinstall: true, this repeats on every click even
when a valid hatch-pet skill is already present.
Root cause
installRecommendedSkill composes the install destination with the app-server's POSIX path
implementation while codexHome may still be in Windows spelling. A Windows-spelled path is not
absolute under POSIX rules, so resolve prepends the Electron process working directory — the
package folder under C:\Program Files\WindowsApps\... — and the result is then translated to a \\wsl$\<distro>\... UNC. Creating \\wsl$\<distro>\Program Files is refused, hence the EPERM.
I reproduced the computation with Node from the app's own working directory. Only the spelling of codexHome varies:
CODEX_HOME seen by the Electron process
computed install destination
C:\Users\<USER>\.codex
\\wsl$\Ubuntu-24.04\Program Files\... → EPERM
\\wsl.localhost\<distro>\home\<user>\.codex
\\wsl$\Ubuntu-24.04\Program Files\... → EPERM
/mnt/c/Users/<USER>/.codex
C:\Users\<USER>\.codex\skills\hatch-pet → correct
Note that resolving the WSL Codex home through wsl.exe cannot produce the working case: every
successful branch of that lookup returns a Windows drive path or a \\wsl$\/\\wsl.localhost\ UNC,
both of which land in the broken column above.
Verification
Launching the stock package with a POSIX-form CODEX_HOME (the per-process alias plus NTFS
junctions described earlier in this thread) makes the button work end to end. After that launch:
the Desktop log records the Codex home as \mnt\c\Users\<USER>\.codex-wsl-pets-shim\...
clicking Create your own pet installs the skill and pre-fills the composer as intended
Failed to install recommended skill count for the session: 0
The same click on the same build, launched normally, fails with the EPERM above.
Why the workaround keeps lapsing
The alias is a per-process environment value, so it disappears when Desktop exits. Any subsequent
launch from the Start menu, a shortcut, or an auto-restart reverts to the Windows-spelled home and
the button breaks again. The NTFS junctions persist; only the variable pointing at them is lost.
Launch history from one machine:
A useful diagnostic for anyone triaging this: executablePath= in the Desktop log points at the
Codex home in use. If it shows a Windows-spelled .codex, custom-pet creation will fail.
One caveat for users applying the workaround: a POSIX-form value is interpreted as a
drive-relative path by Windows processes, so it only resolves for processes running on the drive
that holds the junction. Processes launched from another drive will not find the home.
Requests
Derive the path flavor for pet/skill installation from the selected execution host rather than
the Electron process environment, so Windows-spelled and POSIX-spelled homes both work.
Apply the same boundary fix to installRecommendedSkill, not just custom-pet discovery — the
fix for listing does not cover creation.
Surface the installer error in the UI. The toast text gives no indication that a filesystem
permission error occurred, which is why this reads as an unresponsive button.
In the latest Codex app version, the issue still exists where pets are not read correctly when the working environment is set to WSL2. It appears as the custom pets path in the Codex App showing C:\Users\username\.codex/pets with mixed slashes. Based on my analysis of this patch, it seems to be addressing the same root cause. Unfortunately, the patch does not apply to the latest Codex app version. I also tried to build a new patch myself, but couldn't succeed due to the messy permission restrictions in the WindowsApp directory.
Reproduced on current Windows Desktop build 26.814.5517.0 with WSL backend enabled. I traced the shipped app.asar and can confirm the custom-pet failure mechanism in this build.
preferWsl is false here because the Windows Electron main process itself does not have WSL_DISTRO_NAME, even though the configured execution backend is WSL.
The mixed path is then used by the custom-pet enumeration logic. The directory itself can still be read by Windows native fs, but each pet entry goes through a path-safety helper equivalent to:
Because C:\Users\... is not an absolute path under POSIX semantics, the resolved path is treated as relative to the Electron process cwd. The subsequent relative-path safety check sees a path beginning with .., returns null, and the pet entry is silently filtered before pet.json is read.
So in this build the observed chain is:
Windows CODEX_HOME
+ POSIX path API
-> C:\Users\<USER>\.codex/pets
-> POSIX resolve/relative safety check
-> pet entry rejected
-> custom pet list empty
This also explains why there is no useful runtime error: the failing entry is intentionally converted to null and filtered.
One implication: a fix guarded only by preferWsl === true may not cover the current build, because custom pet enumeration currently reaches this path with preferWsl=false while executionHost.platformPath() is still path.posix.
A safer invariant seems to be: the path API used for join/resolve/relative must match the path representation of codexHome (or codexHome must first be normalized to the execution host's native representation), and the same representation must be preserved through the safety check.
No files/configuration were modified during this investigation.
Following the newer independent reproduction on Desktop 26.814.5517.0, is any additional sanitized diagnostic, reproduction, or package-validation evidence needed from our side to help triage this WSL custom-pet path issue? We can provide targeted evidence without repeating the root-cause material already present in the thread.
I spent my codex usage so that you don't have to. Updated patch for latest version, I have added my own personal pet in there because I am planning on keeping it updated till it gets fixed. It also has the option to replace the main codex pet with your custom one (as a revenge?).
I ran into two changes that matter for current Windows builds when using Codex with WSL:
The WSL path problem now affects three custom-pet operations—listing, loading the selected pet, and creating a pet—so patching only the older loader call site is incomplete.
In package 26.818.5229.0, the AppX manifest declares app/ChatGPT.exe as the desktop UI executable. Codex.exe is a helper, so shortcuts that target it appear to do nothing.
I put a version-locked, reversible implementation at https://github.com/NBrKn/codex-wsl-pets-patch. It discovers the launcher from AppxManifest.xml, checks every input and output by SHA-256, patches a side-by-side copy rather than WindowsApps, uses an isolated profile to avoid the Store app's single-instance lock, verifies all three call sites, and includes safe removal. It also has an optional built-in replacement that keeps the codex id but swaps the visible pet and spritesheet for Ember.
The patch intentionally refuses unknown Codex versions. For a newer Store build, the bundle signatures and checksums need to be re-verified rather than force-applied.
CODEX_HOME visible to the Windows app: C:\Users\<USER>\.codex
Custom pet directory: C:\Users\<USER>\.codex\pets\anon.codex-pet
The package is valid:
pet.json parses successfully
spritesheetPath is spritesheet.webp
spritesheet is a valid VP8L WebP, 1536x1872, approximately 2.56 MiB
Reproduction
Enable the WSL execution environment in Codex Desktop.
Place the valid package under %USERPROFILE%\.codex\pets\anon.codex-pet.
Open Settings → Pets and click Refresh (also reproduced after fully restarting Desktop).
The custom pets list remains empty; the built-in pet is still used.
Open folder opens the expected Windows folder, confirming that the files exist.
Path-level finding
The loader enumerates the Windows directory with Windows filesystem APIs, but then uses the execution host's POSIX path implementation for per-entry path validation. The effective sequence is equivalent to:
Because the Windows drive path is not absolute under POSIX semantics, the path-safety check rejects the entry before reading pet.json. The rejection is converted to null and swallowed by a broad catch, so Refresh produces no visible error.
This explains why:
the folder can be opened from the UI;
Refresh and restart do not help;
a valid package is silently omitted;
mirroring the package under the WSL home does not resolve the Windows Desktop loader path.
Suggested fix
Keep the path representation and path API consistent with the execution host. For example, normalize a Windows Codex home to /mnt/<drive>/... before POSIX resolve/join/relative, or use a host-aware path implementation throughout custom-pet discovery and loading. Also log the rejected path and underlying error instead of silently returning an empty list.
No local files or application bundles were modified during this investigation.
Additional verification: Desktop 26.901.5280.0, WSL backend, valid v2 pet
This still reproduces on Windows x64 with Desktop package 26.901.5280.0 and bundled WSL app-server 0.153.4 (Ubuntu). This is the desktop Settings > Pets picker, not the CLI terminal-pet renderer.
A valid local v2 pet (spriteVersionNumber: 2, WebP 1536 × 2288) appears with Agent Environment set to Windows native.
Switching Agent Environment to WSL and fully restarting makes the custom entry disappear; refreshing does not restore it.
The pet was already present in both Windows-backed and native WSL pet directories. The live Desktop WSL backend used the Windows-backed CODEX_HOME, so copying the files again did not fix the picker.
A read-only harness using the installed bundle's extracted pet-loading/path functions reproduced:
Home representation
Path API
Custom v2 pet
Windows drive path
Windows
Listed
Windows drive path
POSIX / WSL
Omitted
Normalized WSL mount path
POSIX / WSL
Listed
In this build, enumeration can read the directory, but POSIX resolve treats the Windows-spelled home as relative. The resulting per-pet manifest path includes the process cwd followed by the embedded Windows drive path. The harness observed ENOENT, which the loader catches and converts to a null entry. This is consistent with the earlier path-flavor findings; preferWsl alone is not a sufficient guard when the Windows desktop process lacks WSL_DISTRO_NAME.
A process-scoped compatibility launcher using a POSIX-form home, an NTFS junction back to the same original store, and a gated WSL login-shell environment adjustment restored discovery without modifying the installed app bundle. The user subsequently reported that the pet was visible again while continuing to use WSL. Backend initialization also confirmed platformOs=linux and the original shared Codex home. The harness is not an independent UI screenshot test, and pet creation was not revalidated.
This workaround is inconvenient for long-term WSL use: every fresh launch must use the dedicated entry point. Please fix path representation consistently across custom-pet list/load and surface actionable errors instead of silently omitting entries.
Personal paths are generalized here. No session transcripts, credentials, or raw logs are attached.
Switched Codex Desktop to the WSL-backed agent environment and clicked Refresh in Settings > Pets.
Observed: the list still contains built-in pets only. Drake Hotline Bling v2 Test does not appear.
Create pet also fails in WSL
Clicking Create pet shows this toast:
Unable to start pet creation
The desktop log at the same timestamp contains the more specific failure:
Failed to install recommended skill error="EPERM: operation not permitted, mkdir '\\\\wsl$\\Ubuntu\\Program Files'"
According to the current Pets documentation, this action should install the bundled hatch-pet skill, reload skills, and open a new chat. Instead, the recommended-skill installer appears to construct a WSL UNC target rooted at Program Files and fails before chat creation.
This looks related to the same Windows/WSL path-normalization boundary, but affects two distinct paths:
scanning/loading an already installed, valid custom pet from the WSL home;
resolving the installation destination when Create pet installs its recommended skill.
The UI screenshot for this reproduction shows the complete built-in-only pet list together with the Unable to start pet creation toast.
Activity
github-actions commentedon May 2, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
wahyuabrory commentedon May 2, 2026
Confirmed on my machine as well.
Repro: custom pet
clawdis present under~/.codex/pets/clawd/{pet.json,spritesheet.webp}and appears normally when Codex is used from Windows native, but it does not appear in Settings when Codex is run from a WSL2 environment.Observed with
Codex 26.429.30905on@OpenAi.Plan:
Business PlanPlatform:
WindowsThis matches the path-loading behavior described in this issue.
chisong1 commentedon May 3, 2026
Confirmed on my Windows + WSL2 as well.
I added a custom pet at
C:\Users\username\.codex\pets\petname\pet.jsonC:\Users\username\.codex\pets\petname\spritesheet.webpThe same files are also present under the WSL home:
/home/username/.codex/pets/petname/{pet.json,spritesheet.webp}Codex notes that the package validates locally per the hatch pet skill:
pet.jsonpoints tospritesheet.webp, and the spritesheet is a valid1536x1872WebP. The app Settings UI shows the custom pets folder asC:\Users\username\.codex\pets, but after Refresh and app/PC restart, the custom pet still does not appear.Environment:
OpenAI.Codex_26.429.3425.0_x640.128.0-alpha.1runCodexInWindowsSubsystemForLinuxis enabledThis appears to match the WSL path-loading behavior described here.
FabCodeDE commentedon May 6, 2026
Confirmed
RomeoRaven commentedon May 7, 2026
I can add a more specific reproduction and path-level finding for this issue.
Environment
OS: Microsoft Windows 11 Pro, build 26200, x64
Requested PowerShell output:
Microsoft Windows NT 10.0.26200.0 x64Codex Desktop package:
OpenAI.Codex_26.429.8261.0_x64__2p2nqsd0c76g0App version observed in package:
26.429.61741App-server configured to run through WSL
Custom pet installed under the Windows Codex home:
C:\Users\<USER>\.codex\pets\<pet-id>\pet.jsonReproduction
On Windows, create a valid custom pet under:
C:\Users\<USER>\.codex\pets\<pet-id>Open Codex Desktop in Windows native mode.
Go to Settings -> Appearance -> Pets and click Refresh.
The custom pet appears.
Switch Codex Desktop to run in WSL mode.
Restart Codex Desktop.
Go back to Settings -> Appearance -> Pets and click Refresh.
The custom pet does not appear.
This matches the behavior reported in #20905, but with a more specific path-normalization finding.
Path finding
In WSL mode, the custom pet loader appears to construct a mixed Windows/POSIX path like:
C:\Users\<USER>\.codex/petsThe WSL app-server cannot discover pets at that path.
The path needs to be normalized to the WSL mount path before joining
petsoravatars:/mnt/c/Users/<USER>/.codex/petsLocal verification
A local dry-run ASAR patch confirmed the narrow behavior change.
Before:
path.posix.join("C:\\Users\\<USER>\\.codex", "pets")=>
C:\Users\<USER>\.codex/petsAfter normalizing the Codex home when
preferWslis true:/mnt/c/Users/<USER>/.codex/petsA loader-like verifier then discovered the custom pet from:
/mnt/c/Users/<USER>/.codex/pets/<pet-id>/pet.jsonSuggested fix scope
When
preferWslis true and the resolved Codex home is a Windows drive path, normalize it before constructing the custompetsandavatarspaths.Conceptually:
This should be scoped to custom pet/avatar discovery and should not change global CODEX_HOME, app-server launch behavior, terminal command execution, workspace paths, skills, agents, or file browsing helpers
Tairitsua commentedon May 8, 2026
Appreciate the idea @RomeoRaven
If anybody need this urgently, you can use my temporary patch script for now. 😂
https://github.com/Tairitsua/codex-wsl-custom-pets-patch
yui-stingray commentedon May 21, 2026
I can add one data point from a newer Windows build. This does not establish a new root cause, but it narrows the behavior a bit: the UI can open the expected custom pets folder, while the custom pet list/renderer still does not pick up valid packages from that same folder.
Environment
OpenAI.Codex_26.519.2081.0_x64__2p2nqsd0c76g026.519.2081.0Ubuntu-22.04CODEX_HOMEin the WSL app-server process resolves to the WSL view of the Windows Codex homeWSLENVincludesCODEX_HOME/pNote: this is not a clean-install environment. It is a real Windows + WSL Codex Desktop profile that has previously had Desktop/WSL path and local history troubleshooting. I am including this because the issue still reproduces after that profile is in a stable state where local history opens correctly.
Additional observation
Settings > Appearance > Pets, the custom petsOpen folderaction opens the expected folder:<CODEX_HOME_WIN>\petsRefresh custom pets, no custom pets appear in the Pets list.selected-avatar-idto a custom pet folder id, for examplecustom-pet-02, is persisted in.codex-global-state.json.Wake Petor/petstill shows the built-incodexpet, so the renderer appears to fall back after failing to resolve/list/load the selected custom pet.Local package validation
I tested three packages under
<CODEX_HOME_WIN>\pets:For each package:
pet.jsonexists.spritesheet.webpexists.pet.json.idmatches the folder name.pet.json.spritesheetPathpoints to the existingspritesheet.webp.1536x1872RGBA.Example normalized package metadata:
[ { "folder": "custom-pet-01", "id": "custom-pet-01", "displayName": "Custom Pet 01", "spritesheetPath": "spritesheet.webp", "idMatchesFolder": true, "spritesheetExists": true }, { "folder": "custom-pet-02", "id": "custom-pet-02", "displayName": "Custom Pet 02", "spritesheetPath": "spritesheet.webp", "idMatchesFolder": true, "spritesheetExists": true }, { "folder": "custom-pet-03", "id": "custom-pet-03", "displayName": "Custom Pet 03", "spritesheetPath": "spritesheet.webp", "idMatchesFolder": true, "spritesheetExists": true } ]Why this may be useful
Earlier comments already show that custom pets work in Windows native mode but not in WSL mode, and one comment points to a mixed path such as
C:\Users\<USER>\.codex/pets.This newer-build data point suggests there may be two separately visible paths in the UI:
Open folderpath resolves correctly to<CODEX_HOME_WIN>\pets.So the failing path may be specifically in the custom pet scan/list/load code path rather than in the folder-opening helper.
petercr commentedon Jun 3, 2026
I can confirm this is still reproducible in Codex Desktop on Windows.
In Settings > Appearance, the Custom Pets location is displayed with mixed path separators:
The expected Windows path display would be:
Or, if this path is being passed to the renderer for asset loading, it likely needs to be converted to a proper file URL first, e.g.:
This looks like the pets directory is being constructed with a hardcoded POSIX suffix, such as appending
/petsto a Windows%USERPROFILE%\.codexpath, instead of using platform-aware path joining and URL conversion. Custom pets are discovered/shown in the UI, but the mixed root path appears consistent with the load failure.leewaiho commentedon Jul 18, 2026
Still reproducible on a substantially newer Codex Desktop build as of July 18, 2026.
Environment
26200.8875, x64OpenAI.Codex_26.715.3651.0_x64__2p2nqsd0c76g06.18.33.2-microsoft-standard-WSL2codex-cli 0.144.3Reproduction / validation
A valid custom pet package exists in both Codex homes:
The metadata is valid and the folder id matches
pet.json.id:{ "id": "rourou", "displayName": "肉肉 Rourou", "spritesheetPath": "spritesheet.webp" }The files on the Windows and WSL sides are byte-identical:
Despite this, refreshing custom pets in Windows Codex Desktop while the app-server is running through WSL does not make the custom pet available/loadable. The built-in pet remains the only usable pet.
This confirms the problem is still present in Desktop
26.715.3651.0; it is not caused by a missing package or Windows/WSL copies being out of sync. It remains consistent with the WSL custom-pet discovery/path-normalization failure described in this issue.Elevation-mindset commentedon Jul 19, 2026
Reproduced on Codex Desktop 26.715.4045.0 on Windows with the Codex app server running in WSL.
I had 37 valid custom pet packages under
%USERPROFILE%\.codex\pets. Settings showed built-in pets only, with no error. The failure was caused by custom-pet discovery combining a WindowsCODEX_HOMEpath (C:\...) with POSIX path operations from the WSL app server; the resulting mixed path fails and the loader silently returns an empty custom-pet list.A user-local patched copy that normalizes the Windows drive path to
/mnt/c/...before joining thepetsdirectory loaded all 37 pets successfully, including Zoro, Obito, and Sasuke. Selecting pets then worked normally.One extra detail: a separate patched desktop executable must be launched only after fully exiting stock Codex, otherwise the app's single-instance handoff reopens the unpatched WindowsApps build.
malibudawley commentedon Jul 22, 2026
Still reproducible in Codex Desktop 26.715.10079.0 on Windows with a WSL-backed agent environment. A valid v1 pet at C:\Users<USER>.codex\pets\jimothy passes the app’s manifest, dimensions, and WebP parser checks, but Custom pets remains empty after refresh and full restart. Mirroring it to /home//.codex/pets/jimothy does not help. This appears to confirm the mixed Windows/POSIX path-normalization bug described here. Please prioritize a fix.
2 remaining items
malibudawley commentedon Jul 24, 2026
Screen_Recording_20260721_151917_Instagram.mp4
We need Jimothy
charlesdavid commentedon Jul 26, 2026
Still reproducible on the newer Codex Desktop build
OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0.Environment and package validation
runCodexInWindowsSubsystemForLinux = trueC:\Users\<USER>\.codex\pets\pearl1\{pet.json,spritesheet.webp}/home/<USER>/.codex/pets/pearl1/{pet.json,spritesheet.webp}pet.json.idmatches the folder namespriteVersionNumber: 21536x2288WebPThe proposed Windows-side selection workaround was also tested:
The selection persists, but the pet still cannot be resolved or rendered.
Current-build inspection
The packaged desktop code calls the custom-avatar loader with behavior equivalent to:
The Electron host is a Windows process, so
WSL_DISTRO_NAMEis not set even though the configured agent environment is WSL. Consequently,preferWslis false and Codex home resolves as a Windows path. The loader then obtains the WSL/POSIX platform path implementation and joins that Windows home withpets, producing a mixed path such as:This explains why placing identical packages in both the Windows and WSL homes, refreshing, restarting, and directly selecting
custom:pearl1all fail: list and load use the same incorrect resolution boundary.Could a maintainer please:
preferWslfrom the Desktop WSL setting (or normalize the Codex home specifically in custom pet/avatar discovery) rather than the Windows Electron process environment.This has now been reproduced across multiple
26.721builds and prevents all custom-pet use for users who need to retain WSL for their development environment.lgonzalezm-dev commentedon Jul 26, 2026
Independent reproduction on the current
26.721.4979.0Windows package, with two valid v2 pets and some additional loader-level evidence.Environment
OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0Ubuntu-24.04runCodexInWindowsSubsystemForLinux = truespawnCommand=wsl.exeC:\Users\<USER>\.codex/mnt/c/Users/<USER>/.codexPet packages tested
Two v2 packages were installed in both the Windows Codex home and the WSL user home:
satoru-gojosasukeFor both packages:
pet.jsonparses successfullyspritesheetPathresolves to the existingspritesheet.webpspriteVersionNumberis2VP8Ldata as exactly1536x228826.721.4979.0loader returnstrueDespite this,
Settings > Pets > Refreshdoes not list either custom pet. Mirroring the packages under/home/<USER>/.codex/petsdoes not help.Loader finding
The current package does not use a separate pet registry. It enumerates
CODEX_HOME/pets/*/pet.jsondirectly. The main-process service calls the loader with behavior equivalent to:The Windows Electron process does not reliably expose the configured Desktop WSL mode through
process.env.WSL_DISTRO_NAME, whileexecutionHostRegistry.get()is backed by the WSL/POSIX app-server host. The loader can therefore join a Windows home with a POSIX path implementation and construct:One additional reason this is difficult to diagnose from logs: the loader wraps creation/access of the computed pets directory in a broad
try/catch; on failure it returns{ avatarDirectory, avatars: [] }. Individual manifest/load failures are also caught and returned asnull, so Refresh can silently show an empty custom-pet list even though both packages validate.This independently confirms the
26.721mixed Windows/POSIX resolution boundary. Deriving the pet loader's path flavor from the selected execution host/Desktop WSL setting, rather than the Electron process environment, should address both list and load.matthewclso commentedon Jul 28, 2026
I found and locally validated a non-patched, reversible workaround for users who need to keep Codex Desktop's agent environment set to WSL. It uses the stock Microsoft Store package: no ASAR changes, unsigned executable, package replacement, or pet-file duplication.
Validated on
OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0. Both custom-pet listing and loading worked through the workaround.Why it works
The current loader effectively combines a Windows
CODEX_HOMEwith the WSL/POSIX path implementation. Giving the Windows Electron process a POSIX-formCODEX_HOMEavoids that mixed path. Two NTFS directory junctions make the same alias resolvable from both sides:.codexmakes/mnt/<drive>/.../.codex-wsl-pets-shimwork inside WSL.\mnt\...tree handles Windows-side Node calls that interpret/mnt/...as a root-relative Windows path.The WSL app-server itself remains on the real shared Codex home, preventing config/auth/session state from splitting between Windows and WSL.
Important assumptions and cautions
/mnt. Ifautomount.rootwas customized in/etc/wsl.conf, change$wslMountRootin every block below.%USERPROFILE%\.codexdirectory.WSL_DISTRO_NAMEor globally set WindowsCODEX_HOMEto the POSIX alias.1. Create the two aliases once
Run this in Windows PowerShell:
Directory junctions normally do not require Developer Mode. If creating the parent under the app drive fails with
Access denied, rerun this one-time setup in an elevated PowerShell window.2. Keep the WSL app-server on the real shared home
In the same WSL distro Codex Desktop uses, add the
export CODEX_HOME=...line printed by the setup script to the active login-shell profile.Usually this is
~/.profile:Use the exact line printed for the machine; the example above is only illustrative. If
~/.bash_profileexists, add it there instead or make it source~/.profile.This step matters because Desktop launches the WSL app-server through a login shell. It ensures the WSL process continues using the real Windows-backed Codex home for configuration, authentication, sessions, skills, and pets, while only Electron sees the alias.
3. Launch the stock app with the per-process alias
Fully quit Codex Desktop first, including its tray/background process. Because Desktop is single-instance, launching while an old process remains will hand off to that process and ignore the new environment.
Save the following as, for example,
Start-Codex-WslPets.ps1, or paste it into PowerShell whenever starting Codex:This launcher discovers the current installed package path, so normal updates on the same app drive do not require hard-coding a versioned
WindowsAppsdirectory.After launch, leave the agent environment set to WSL, then open Settings → Pets and click Refresh custom pets. Existing custom pets under the real
%USERPROFILE%\.codex\petsshould appear; no copy under/home/<wsl-user>/.codex/petsis needed.The launcher must be used after each complete exit while the affected build is installed. It changes only the child process environment and does not set a permanent Windows environment variable.
Rollback
Fully quit Codex. Run the following in PowerShell; it verifies both paths are junctions targeting the real
.codexbefore removing them:rmdirremoves only these two...-wsl-pets-shimjunctions, not their target or any pet/config/session data. The WSL profile's realCODEX_HOMEexport can remain; remove that line only if Windows and WSL should no longer share a Codex home.After a Codex update, first try launching normally. If custom pets work with WSL without this launcher, roll back the aliases and delete the launcher.
ChinFish commentedon Aug 4, 2026
Independent reproduction on the current Windows package
OpenAI.Codex_26.727.6591.0_x64__2p2nqsd0c76g0.Environment
runCodexInWindowsSubsystemForLinux = true0.146.0-alpha.9.2spawnCommand=wsl.execustom:qingrong-alpacaPackage validation
A V1 custom pet was installed in both locations:
C:\Users\<USER>\.codex\pets\qingrong-alpaca\{pet.json,spritesheet.webp}/home/<USER>/.codex/pets/qingrong-alpaca/{pet.json,spritesheet.webp}The two copies have matching SHA-256 hashes. The spritesheet passes the current Hatch Pet validator:
1536x1872pet.json.spritesheetPathresolves to the existing fileAfter Refresh, full tray exit, and restart, Desktop still renders the built-in default pet instead of the selected custom pet.
Runtime evidence
Immediately after the
avatarOverlaywindow starts, the Desktop log records:The packaged loader in this build still appears to select WSL preference using behavior equivalent to:
while the Electron host is a Windows process and the execution host is the WSL/POSIX app-server. This remains consistent with the mixed Windows/POSIX custom-pet path described in this issue.
This also looks like a regression or incomplete fix relative to #21471, which was closed as completed. Could the team please re-check custom pet discovery/loading with WSL-backed Desktop on the current
26.727release line?Sicari1 commentedon Aug 4, 2026
Additional failure mode on
26.727.6591.0: "Create your own pet" fails, and the trigger is the spelling ofCODEX_HOMEFollowing up on my earlier comment. This is a distinct symptom from the list/render failures reported so far, and it isolates the boundary to a single condition.
Environment
OpenAI.Codex_26.727.6591.0_x64__2p2nqsd0c76g0Ubuntu-24.04runCodexInWindowsSubsystemForLinux = truespawnCommand=wsl.exeSymptom
Settings > Pets > Create your own petappears inert. Clicking it produces only theUnable to start pet creationtoast, so it reads as a dead button. The Desktop log shows thereal failure, once per click:
Because the UI calls the installer with
forceReinstall: true, this repeats on every click evenwhen a valid
hatch-petskill is already present.Root cause
installRecommendedSkillcomposes the install destination with the app-server's POSIXpathimplementation while
codexHomemay still be in Windows spelling. A Windows-spelled path is notabsolute under POSIX rules, so
resolveprepends the Electron process working directory — thepackage folder under
C:\Program Files\WindowsApps\...— and the result is then translated to a\\wsl$\<distro>\...UNC. Creating\\wsl$\<distro>\Program Filesis refused, hence the EPERM.I reproduced the computation with Node from the app's own working directory. Only the spelling of
codexHomevaries:CODEX_HOMEseen by the Electron processC:\Users\<USER>\.codex\\wsl$\Ubuntu-24.04\Program Files\...→ EPERM\\wsl.localhost\<distro>\home\<user>\.codex\\wsl$\Ubuntu-24.04\Program Files\...→ EPERM/mnt/c/Users/<USER>/.codexC:\Users\<USER>\.codex\skills\hatch-pet→ correctNote that resolving the WSL Codex home through
wsl.execannot produce the working case: everysuccessful branch of that lookup returns a Windows drive path or a
\\wsl$\/\\wsl.localhost\UNC,both of which land in the broken column above.
Verification
Launching the stock package with a POSIX-form
CODEX_HOME(the per-process alias plus NTFSjunctions described earlier in this thread) makes the button work end to end. After that launch:
\mnt\c\Users\<USER>\.codex-wsl-pets-shim\...Create your own petinstalls the skill and pre-fills the composer as intendedFailed to install recommended skillcount for the session: 0The same click on the same build, launched normally, fails with the EPERM above.
Why the workaround keeps lapsing
The alias is a per-process environment value, so it disappears when Desktop exits. Any subsequent
launch from the Start menu, a shortcut, or an auto-restart reverts to the Windows-spelled home and
the button breaks again. The NTFS junctions persist; only the variable pointing at them is lost.
Launch history from one machine:
A useful diagnostic for anyone triaging this:
executablePath=in the Desktop log points at theCodex home in use. If it shows a Windows-spelled
.codex, custom-pet creation will fail.One caveat for users applying the workaround: a POSIX-form value is interpreted as a
drive-relative path by Windows processes, so it only resolves for processes running on the drive
that holds the junction. Processes launched from another drive will not find the home.
Requests
the Electron process environment, so Windows-spelled and POSIX-spelled homes both work.
installRecommendedSkill, not just custom-pet discovery — thefix for listing does not cover creation.
permission error occurred, which is why this reads as an unresponsive button.
nelittle commentedon Aug 4, 2026
Confirmed still happening with latest version (July 31, 2026, Version 26.727.51351)
Feedback ID: 019fca72-34dd-7663-8221-b52cd96467ed
完善 README 安装说明:三种安装方式、macOS、WSL 故障排查
amiibot commentedon Aug 12, 2026
In the latest Codex app version, the issue still exists where pets are not read correctly when the working environment is set to WSL2. It appears as the custom pets path in the Codex App showing
C:\Users\username\.codex/petswith mixed slashes. Based on my analysis of this patch, it seems to be addressing the same root cause. Unfortunately, the patch does not apply to the latest Codex app version. I also tried to build a new patch myself, but couldn't succeed due to the messy permission restrictions in the WindowsApp directory.Hadeanyolo commentedon Aug 19, 2026
Reproduced on current Windows Desktop build
26.814.5517.0with WSL backend enabled. I traced the shippedapp.asarand can confirm the custom-pet failure mechanism in this build.Environment (sanitized):
The important detail is that the current call chain is slightly different from the earlier
preferWsl=truehypothesis:preferWslisfalsehere because the Windows Electron main process itself does not haveWSL_DISTRO_NAME, even though the configured execution backend is WSL.The mixed path is then used by the custom-pet enumeration logic. The directory itself can still be read by Windows native
fs, but each pet entry goes through a path-safety helper equivalent to:Because
C:\Users\...is not an absolute path under POSIX semantics, the resolved path is treated as relative to the Electron process cwd. The subsequent relative-path safety check sees a path beginning with.., returnsnull, and the pet entry is silently filtered beforepet.jsonis read.So in this build the observed chain is:
This also explains why there is no useful runtime error: the failing entry is intentionally converted to
nulland filtered.One implication: a fix guarded only by
preferWsl === truemay not cover the current build, because custom pet enumeration currently reaches this path withpreferWsl=falsewhileexecutionHost.platformPath()is stillpath.posix.A safer invariant seems to be: the path API used for
join/resolve/relativemust match the path representation ofcodexHome(orcodexHomemust first be normalized to the execution host's native representation), and the same representation must be preserved through the safety check.No files/configuration were modified during this investigation.
RomeoRaven commentedon Aug 22, 2026
Following the newer independent reproduction on Desktop
26.814.5517.0, is any additional sanitized diagnostic, reproduction, or package-validation evidence needed from our side to help triage this WSL custom-pet path issue? We can provide targeted evidence without repeating the root-cause material already present in the thread.Prepared by Hermes with AI assistance.
NBrKn commentedon Aug 24, 2026
I spent my codex usage so that you don't have to. Updated patch for latest version, I have added my own personal pet in there because I am planning on keeping it updated till it gets fixed. It also has the option to replace the main codex pet with your custom one (as a revenge?).
I ran into two changes that matter for current Windows builds when using Codex with WSL:
26.818.5229.0, the AppX manifest declaresapp/ChatGPT.exeas the desktop UI executable.Codex.exeis a helper, so shortcuts that target it appear to do nothing.I put a version-locked, reversible implementation at https://github.com/NBrKn/codex-wsl-pets-patch. It discovers the launcher from
AppxManifest.xml, checks every input and output by SHA-256, patches a side-by-side copy rather thanWindowsApps, uses an isolated profile to avoid the Store app's single-instance lock, verifies all three call sites, and includes safe removal. It also has an optional built-in replacement that keeps thecodexid but swaps the visible pet and spritesheet for Ember.The patch intentionally refuses unknown Codex versions. For a newer Store build, the bundle signatures and checksums need to be re-verified rather than force-applied.
yykina commentedon Aug 30, 2026
Additional reproduction: Desktop 26.825.6671.0
This remains reproducible on the current Windows Desktop package when the configured execution backend is WSL2 (Ubuntu 22.04).
Environment
OpenAI.Codex_26.825.6671.0_x64__2p2nqsd0c76g0CODEX_HOMEvisible to the Windows app:C:\Users\<USER>\.codexC:\Users\<USER>\.codex\pets\anon.codex-petThe package is valid:
pet.jsonparses successfullyspritesheetPathisspritesheet.webp1536x1872, approximately 2.56 MiBReproduction
%USERPROFILE%\.codex\pets\anon.codex-pet.Path-level finding
The loader enumerates the Windows directory with Windows filesystem APIs, but then uses the execution host's POSIX path implementation for per-entry path validation. The effective sequence is equivalent to:
Because the Windows drive path is not absolute under POSIX semantics, the path-safety check rejects the entry before reading
pet.json. The rejection is converted tonulland swallowed by a broadcatch, so Refresh produces no visible error.This explains why:
Suggested fix
Keep the path representation and path API consistent with the execution host. For example, normalize a Windows Codex home to
/mnt/<drive>/...before POSIXresolve/join/relative, or use a host-aware path implementation throughout custom-pet discovery and loading. Also log the rejected path and underlying error instead of silently returning an empty list.No local files or application bundles were modified during this investigation.
minoteseller commentedon Sep 5, 2026
Additional verification: Desktop 26.901.5280.0, WSL backend, valid v2 pet
This still reproduces on Windows x64 with Desktop package
26.901.5280.0and bundled WSL app-server0.153.4(Ubuntu). This is the desktop Settings > Pets picker, not the CLI terminal-pet renderer.spriteVersionNumber: 2, WebP1536 × 2288) appears with Agent Environment set to Windows native.CODEX_HOME, so copying the files again did not fix the picker.A read-only harness using the installed bundle's extracted pet-loading/path functions reproduced:
In this build, enumeration can read the directory, but POSIX
resolvetreats the Windows-spelled home as relative. The resulting per-pet manifest path includes the process cwd followed by the embedded Windows drive path. The harness observedENOENT, which the loader catches and converts to a null entry. This is consistent with the earlier path-flavor findings;preferWslalone is not a sufficient guard when the Windows desktop process lacksWSL_DISTRO_NAME.A process-scoped compatibility launcher using a POSIX-form home, an NTFS junction back to the same original store, and a gated WSL login-shell environment adjustment restored discovery without modifying the installed app bundle. The user subsequently reported that the pet was visible again while continuing to use WSL. Backend initialization also confirmed
platformOs=linuxand the original shared Codex home. The harness is not an independent UI screenshot test, and pet creation was not revalidated.This workaround is inconvenient for long-term WSL use: every fresh launch must use the dedicated entry point. Please fix path representation consistently across custom-pet list/load and surface actionable errors instead of silently omitting entries.
Personal paths are generalized here. No session transcripts, credentials, or raw logs are attached.
al-osokin commentedon Sep 12, 2026
Still reproducible on the current Codex desktop build, with a second WSL-specific failure in the Create pet flow.
Environment
OpenAI.Codex_26.908.4834.0_x64__2p2nqsd0c76g026.908.40834CODEX_HOMEis unset, so the normal Linux default is expectedControlled custom-pet discovery test
Took a custom v2 pet that currently loads correctly in Windows native mode.
Validated its spritesheet with the bundled
hatch-petvalidator using--require-v2:1536 x 2288spriteVersionNumber: 2ok: true, no errors or warningsInstalled a separate copy under:
Confirmed the copied spritesheet SHA-256 is identical to the working Windows package:
Switched Codex Desktop to the WSL-backed agent environment and clicked Refresh in Settings > Pets.
Observed: the list still contains built-in pets only.
Drake Hotline Bling v2 Testdoes not appear.Create pet also fails in WSL
Clicking Create pet shows this toast:
The desktop log at the same timestamp contains the more specific failure:
According to the current Pets documentation, this action should install the bundled
hatch-petskill, reload skills, and open a new chat. Instead, the recommended-skill installer appears to construct a WSL UNC target rooted atProgram Filesand fails before chat creation.This looks related to the same Windows/WSL path-normalization boundary, but affects two distinct paths:
The UI screenshot for this reproduction shows the complete built-in-only pet list together with the
Unable to start pet creationtoast.