Codex Crashes on a SUBST Drive? Reopen the Physical Path

Codex Crashes on a SUBST Drive? Reopen the Physical Path

Aident AI

Cobalt and coral paper ribbons knot together before resolving into one calm emerald path.

Codex Crashes on a SUBST Drive? Reopen the Physical Path

If Codex Desktop on Windows opens a project through a SUBST drive and starts showing an empty file browser, repeated ENOENT errors, or crashes, remove that project entry from the Codex sidebar and reopen the same repository through its physical path. For example, replace X:\workspace\repo with D:\codex-subst\workspace\repo.

Keep the SUBST mapping if other tools need it. The important containment step is to give Codex one path identity for the repository instead of opening the alias and physical path together.

This workaround is based on an open Codex issue with an independent reproduction. It is not a confirmed upstream fix, and it does not prove that every Codex crash on Windows comes from path normalization.

Match the Exact Failure Signature

Use this guide only when several of these details line up:

Check

Matching SUBST failure

Different problem

Drive mapping

subst shows the workspace drive points to a local physical directory

The drive is a network share, WSL path, removable disk, or normal volume

Codex project identity

The same repository has been opened as both X:\... and D:\...

Only one spelling has ever been used

File browser

Workspace -> Open file is empty or fails

Files appear, but commands fail inside the sandbox

Log symptom

A path contains two drive-qualified paths joined together, such as D:\repo\X:\repo

The missing path contains only one valid drive root

Workaround

Reopening the physical path restores normal behavior

The physical path fails in the same way

The reported malformed path looked like this:

D:\codex-subst\workspace\repo\R:\workspace

That string is the strongest classifier. A generic ENOENT message is not enough because missing files, stale worktrees, WSL bridges, permissions, and sandbox startup failures can all produce similar errors.

Recover Without Deleting the Repository

First, confirm the mapping in Command Prompt or PowerShell:

subst

Find the row for the drive Codex currently uses. It should map an alias such as R: or X: to a local directory on another drive.

Then recover in this order:

  1. Record the alias path and its physical target from subst.

  2. Confirm the physical directory exists in File Explorer and contains the expected repository.

  3. Finish or stop any command that is actively writing files in the affected task.

  4. Remove only the alias-based project entry from the Codex sidebar. Do not delete the directory from disk.

  5. In Codex, open the physical path shown by subst.

  6. Start a fresh test task in that physical-path project and open Workspace -> Open file.

  7. Keep only the physical-path entry in Codex while this upstream issue remains open.

The original report stopped crashing after switching to the physical directory. A second user reproduced the empty file browser and malformed watcher path across multiple repositories under a substituted drive, then confirmed that ordinary Git, terminal, and agent filesystem access still worked. That combination points to Codex's workspace identity and watcher boundary rather than damaged project files.

Why Two Valid Paths Become One Invalid Path

Windows SUBST associates a local path with a virtual drive letter. The alias and physical path can both be valid names for the same directory.

The open issue reconstructs a likely failure using Node's Windows path rules:

const path = require('path').win32;

const physical = 'D:\\codex-subst\\workspace\\repo';
const alias = 'R:\\workspace\\repo';
const relative = path.relative(physical, alias);

console.log(relative);
// R:\workspace\repo

console.log(path.join(physical, relative));
// D:\codex-subst\workspace\repo\R:\workspace\repo

When the two inputs have different drive roots, path.relative() can return a drive-qualified path. If later code treats that result as an ordinary relative segment and joins it to the physical root, the app gets a path that cannot exist.

This mechanism is a strong reproduction of the observed string, but it remains an inference until the Codex maintainers identify the exact code path. Do not patch Codex's installed application files based on this explanation.

Verify the Workaround

The recovery is successful only when all of these observations hold:

  1. Codex shows the project under the physical path only.

  2. Workspace -> Open file displays the repository tree.

  3. Opening a known file succeeds.

  4. A new task can read the repository and run a harmless command such as git status.

  5. New logs do not contain a path with both the physical drive and SUBST drive joined together.

  6. The app remains stable through the workflow that previously triggered the failure.

Check the logs for the exact malformed path, not just the number of errors. Old log entries will remain after the workaround and do not prove the current project is still broken.

Reproduce It in a Disposable Folder

If you need a clean upstream reproduction, do not use a production repository. Create a temporary local folder and map a spare drive letter to it:

New-Item -ItemType Directory -Path C:\codex-subst-repro
git -C C:\codex-subst-repro init
subst R: C:\codex-subst-repro
subst

Open R:\ in Codex, then open the same folder as C:\codex-subst-repro. Test Workspace -> Open file and capture only the relevant watcher error.

When the test is finished, close both disposable project entries and remove the temporary mapping:

subst R: /d

Delete the temporary folder only after you confirm it contains no work you need. A single failing and passing comparison is enough; repeated crashes do not add useful evidence.

Do Not Use Broad Resets for This Bug

Avoid these actions while the repository is healthy at its physical path:

  • deleting .git, .codex, conversation databases, or the repository;

  • reinstalling Codex before testing one canonical path;

  • editing Codex's state database to replace paths;

  • removing every SUBST mapping on the machine;

  • opening both path spellings again to see which one Codex chooses;

  • treating every Windows ENOENT as this same bug.

The containment is intentionally narrow: one repository, one physical path, one Codex project identity.

Separate SUBST From Other Windows Path Bugs

Codex has had other Windows path-normalization reports involving C:\... versus \\?\C:\..., mapped network drives, UNC paths, WSL paths, and sandbox bridges. Those reports support the broader need to compare canonical file identity, but their fixes do not establish that the SUBST composition bug is resolved.

Use the symptom boundary:

  • D:\repo\R:\repo in one path: follow this SUBST guide;

  • C:\... versus \\?\C:\... on resume: update Codex and check the running-thread normalization fix;

  • a network or UNC drive: keep that issue separate from a local SUBST alias;

  • commands fail but the file browser works: diagnose the sandbox or shell boundary instead.

Monitor the Upstream Issue With Aident Loadout

Start with the canonical setup instruction:

Follow https://aident.ai/SETUP.md

Then give your agent a bounded, read-only check:

Check Aident Loadout authentication and Vault status. Discover the current GitHub issue-read Action and Exa search Action, inspect both input schemas, and preflight them. If the estimates are within the configured limit, read openai/codex issue 37525 and search for new Codex SUBST or mapped-drive path-normalization fixes. Return the issue state, last update, human confirmation count, linked fixes, and whether any release is confirmed to contain the fix. Do not create, edit, label, close, comment on, or react to issues.

Set up Aident Loadout and monitor the Codex SUBST path bug read-only.

The measurable result is one current issue record plus a bounded list of related fixes, with no provider write. As of August 8, 2026, issue 37525 was open, had one human confirmation in addition to the original report, and did not name a released Codex version containing a fix.

Sources

Refresh this guide when issue 37525 changes state, a Codex release explicitly fixes SUBST workspace identity, or the physical-path workaround stops clearing the malformed watcher path.

Home

Home

Home

Integrations

Integrations

Integrations

Vault

Vault

Vault

Audit

Audit

Audit

Arana Grande

Arana Grande

Arana Grande

Free

Free

Free

30-day audit summary

30-day audit summary

30-day audit summary

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

View Audit

View Audit

View Audit

Loadout usage

Loadout usage

Loadout usage

617 action calls in the last 30 days

617 action calls in the last 30 days

617 action calls in the last 30 days

May 19 - Jun 17

May 19 - Jun 17

May 19 - Jun 17

10 active days

10 active days

10 active days

Less

Less

Less

More

More

More

Recent activity

Recent activity

Recent activity

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Shopify

Shopify

Shopify

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Success

Success

Success

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Success

Success

Success

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Failed

Failed

Failed

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Connected integration coverage

Connected integration coverage

Connected integration coverage

162

162

162

of 753 accessible connected

of 753 accessible connected

of 753 accessible connected

Callable actions

Callable actions

Callable actions

1,126

1,126

1,126

Vault credentials

Vault credentials

Vault credentials

8

8

8

Explore what's possible

Explore what's possible

Explore what's possible

See all Integrations

See all Integrations

See all Integrations

Google Ads

Google Ads

Google Ads

All available Goolge Ads tools via...

All available Goolge Ads tools via...

All available Goolge Ads tools via...

X (twitter)

X (twitter)

X (twitter)

All available X tools via...

All available X tools via...

All available X tools via...

Github

Github

Github

All available Github tools via...

All available Github tools via...

All available Github tools via...

Notion

Notion

Notion

All available Notion tools via...

All available Notion tools via...

All available Notion tools via...

Slack

Slack

Slack

All available Slack tools via...

All available Slack tools via...

All available Slack tools via...

Firecrawl

Firecrawl

Firecrawl

All available Firecrawl tools via...

All available Firecrawl tools via...

All available Firecrawl tools via...

753 integrations are available for loadouts.

753 integrations are available for loadouts.

753 integrations are available for loadouts.

The one tool

for every tool

your agent needs.

Give any AI agent real capabilities in seconds. Connect 1,000+ tools once, skip the setup headache, and let your agents execute.

Try Aident Loadout

Give your Agent real capabilities in minutes. Connect 1,000+ tools, and let your agents execute.

Try Aident Loadout

Give your Agent real capabilities in minutes. Connect 1,000+ tools, and let your agents execute.

Try Aident Loadout

Give your Agent real capabilities in minutes. Connect 1,000+ tools, and let your agents execute.