VS Code extension app-server exits in a fresh devcontainer because ~/.codex does not exist

Open
#33,849 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, rust, vscode

Research direction

Reproduce the failure with the Rust image and the extension entry in devcontainer.json, ensuring /home/vscode/.codex is absent. Start with the remote Codex.log path and trace the extension's app-server launch and CODEX_HOME handling; done means a fresh container reaches the Codex sign-in or setup screen instead of remaining on the loading view.

Written by the indexing model from the issue text.

Description

app-server bug extension
What version of the IDE extension are you using?

openai.chatgpt-26.707.91948-linux-arm64

What subscription do you have?

Business

Which IDE are you using?

Visual Studio Code 1.129.0 with Dev Containers 0.466.0

What platform is your computer?

Host: Darwin 25.5.0 arm64 arm; Remote environment: VS Code devcontainer Linux ARM64 mcr.microsoft.com/devcontainers/rust:2-1-trixie

What issue are you seeing?

On the first launch of the Codex extension inside a fresh devcontainer, the Codex panel remains stuck on the logo/loading view.

The extension itself installs successfully in the remote VS Code Server and begins activation. However, its bundled Codex app-server exits immediately because /home/vscode/.codex does not exist:

[info] Activating Codex extension
[info] [CodexMcpConnection] Spawning codex app-server
[error] [CodexMcpConnection] cli: message="WARNING: proceeding, even though we could not create PATH aliases: CODEX_HOME points to \"/home/vscode/.codex\", but that path does not exist
Error: CODEX_HOME points to \"/home/vscode/.codex\", but that path does not exist"
[error] [CodexMcpConnection] Codex process fatal error errorMessage="Codex process errored: Codex app-server process exited unexpectedly (code=1, signal=null)."
[error] [CodexWebviewProvider] Fatal error message="Codex process errored: Codex app-server process exited unexpectedly..."

Neither the repository, .devcontainer/.env, devcontainer.json, nor the container configuration explicitly sets CODEX_HOME.

A new devcontainer naturally does not have /home/vscode/.codex yet. The extension-launched app-server treats this first-run state as fatal, while the webview remains indefinitely on its loading screen.

What steps can reproduce the bug?
  1. Create a devcontainer based on the Rust devcontainer image:
FROM mcr.microsoft.com/devcontainers/rust:2-1-trixie
  1. Configure VS Code to install the Codex extension inside the container:
{
  "name": "Rust devcontainer",
  "service": "app",
  "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
  "customizations": {
    "vscode": {
      "extensions": [
        "openai.chatgpt"
      ]
    }
  }
}
  1. Ensure this is a fresh container where /home/vscode/.codex does not already exist.
  2. Open the repository in the devcontainer.
  3. Open the Codex panel.
  4. Observe that the panel remains on the logo/loading screen.
  5. Inspect the remote log at:
/home/vscode/.vscode-server/data/logs/<timestamp>/exthost1/openai.chatgpt/Codex.log
  1. Observe that the app-server exited because /home/vscode/.codex does not exist.
What is the expected behavior?

The extension should support first-run activation in a clean remote environment.

It should either:

  1. create ~/.codex with appropriate ownership and permissions;
  2. allow the Codex runtime to initialize its default state directory; or
  3. display an actionable error instead of leaving the webview stuck indefinitely.

Installing the extension through devcontainer.json should be sufficient to reach the Codex sign-in or initial setup screen.

Additional information

The remote extension package was downloaded, signature-verified, and installed successfully. The failure occurs after activation when the extension spawns its app-server.

Creating /home/vscode/.codex during the image build appears to be a possible workaround:

RUN install -d -o vscode -g vscode /home/vscode/.codex

The remote extension-host log also contains the following warning:

PendingMigrationError: navigator is now a global in nodejs

That appears to be separately tracked by openai/codex#26509. The deterministic fatal error reported here is the app-server exit caused by the missing Codex home directory.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.