Custom pets fail to load in WSL environments due to path normalization
Summary
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.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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.
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.
Confirmed
I can add a more specific reproduction and path-level finding for this issue.
## Environment
Microsoft Windows NT 10.0.26200.0 x64OpenAI.Codex_26.429.8261.0_x64__2p2nqsd0c76g026.429.61741C:\Users\<USER>\.codex\pets\<pet-id>\pet.json## Reproduction
C:\Users\<USER>\.codex\pets\<pet-id>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/pets## Local 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.json## Suggested fix scope
When
preferWslis true and the resolved Codex home is a Windows drive path, normalize it before constructing the custompetsandavatarspaths.Conceptually:
``
ts/mnt/${codexHome[0].toLowerCase()}/${codexHomefunction normalizeCodexHomeForWsl(codexHome: string, preferWsl: boolean): string {
if (preferWsl && /^[a-zA-Z]:[\\/]/.test(codexHome)) {
return
.slice(3)
.replace(/\\/g, "/")}`;
}
return codexHome;
}
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
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:
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.
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.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: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.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.