Skip to content

Windows managed daemon opens two visible console windows when starting Codex CLI #48090

Closed as duplicate

Description

@viniciusbtech

What version of Codex CLI is running?

codex-cli 0.157.0

What subscription do you have?

ChatGPT Plus

Which model were you using?

Default model

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

VS Code integrated terminal using Windows PowerShell. Windows Terminal is also installed: Windows Terminal 1.24.11911.0 The issue occurs when launching Codex from PowerShell.

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1790342939s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.157.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is running",
      "details": {
        "app-server version": "0.157.0",
        "control socket": "C:\\Users\\Vinicius\\.codex\\app-server-control\\app-server-control.sock",
        "daemon state dir": "C:\\Users\\Vinicius\\.codex\\app-server-daemon",
        "dedicated pid file": "C:\\Users\\Vinicius\\.codex\\app-server-daemon\\daemon.pid (file)",
        "dedicated update-loop pid file": "C:\\Users\\Vinicius\\.codex\\app-server-daemon\\daemon-updater.pid (file)",
        "mode": "ephemeral",
        "pid file": "C:\\Users\\Vinicius\\.codex\\app-server-daemon\\app-server.pid (missing)",
        "settings": "C:\\Users\\Vinicius\\.codex\\app-server-daemon\\settings.json (missing)",
        "status": "running",
        "update-loop pid file": "C:\\Users\\Vinicius\\.codex\\app-server-daemon\\app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 5
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "C:\\Users\\Vinicius\\.codex\\auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "C:\\Users\\Vinicius\\.codex",
        "active thread overrides": "not inspected",
        "config.toml": "C:\\Users\\Vinicius\\.codex\\config.toml",
        "config.toml parse": "ok",
        "configuration load ms": "6",
        "configuration scope": "invocation config, including cloud-managed policy",
        "cwd": "C:\\WINDOWS\\System32",
        "enabled feature flags": "<redacted>",
        "feature flag overrides": "none",
        "feature flags enabled": "53",
        "log dir": "C:\\Users\\Vinicius\\.codex\\log",
        "mcp servers": "1",
        "model": "gpt-6-astra",
        "model provider": "openai",
        "sqlite home": "C:\\Users\\Vinicius\\.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "desktop.app.version": {
      "id": "desktop.app.version",
      "category": "desktop",
      "status": "ok",
      "summary": "the desktop application is installed",
      "details": {
        "log directory": "$HOME\\AppData\\Local\\Codex/Logs",
        "running": "false",
        "version": "26.917.9434.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "desktop.app_server.handshake": {
      "id": "desktop.app_server.handshake",
      "category": "desktop",
      "status": "ok",
      "summary": "the desktop application is not running",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "desktop.security.enforcement": {
      "id": "desktop.security.enforcement",
      "category": "desktop",
      "status": "ok",
      "summary": "no locally visible recent Codex security enforcement was found",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git executable found; execution not verified",
      "details": {
        "PATH git #1": "C:\\Program Files\\Git\\cmd\\git.exe",
        "PATH git entries": "1",
        "git execution": "not inspected (PATH helpers are not executed)",
        "repo detected": "false",
        "selected git": "C:\\Program Files\\Git\\cmd\\git.exe"
      },
      "remediation": null,
      "durationMs": 6
    },
    "git.worktree.dev_drive": {
      "id": "git.worktree.dev_drive",
      "category": "git",
      "status": "ok",
      "summary": "no Git worktree is active",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "C:\\Users\\Vinicius\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "current executable": "C:\\Users\\Vinicius\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "install context": "standalone (windows, package C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc, bin C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\codex-path)",
        "managed by Vite+": "false",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed by pnpm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 3
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "warning",
      "summary": "MCP configuration has optional issues",
      "details": {
        "configured servers": "1",
        "disabled servers": "0",
        "node_repl": "env var CODEX_WINDOWS_REGISTERED_CORE is not set",
        "stdio servers": "1"
      },
      "remediation": "Set the missing MCP env vars or disable the affected server.",
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "managed proxy": "not configured",
        "proxy env vars": "none",
        "respect system proxy": "disabled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT inference URL": "https://chatgpt.com/backend-api/<redacted> reachable (HTTP 405)",
        "desktop assets CDN": "https://persistent.oaistatic.com/codex-app-prod/<redacted> reachable (HTTP 200)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 312
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv6",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 655
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on windows-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "C:\\Users\\Vinicius\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
        "install method": "standalone (windows, package C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc, bin C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\codex-path)",
        "platform": "windows-x86_64",
        "version": "0.157.0"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search command found (bundled); execution not verified",
      "details": {
        "search command": "C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases\\0.157.0-x86_64-pc-windows-msvc\\codex-path\\rg.exe",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.filesystem_paths": {
      "id": "sandbox.filesystem_paths",
      "category": "sandbox",
      "status": "ok",
      "summary": "no explicit filesystem paths to probe",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "denied-read glob rules": "0",
        "denied-read restrictions": "false",
        "denied-read rules": "0",
        "execve wrapper helper": "none",
        "filesystem sandbox": "restricted",
        "glob scan max depth": "unbounded",
        "managed filesystem source": "none",
        "network sandbox": "restricted",
        "sandbox backend": "elevated",
        "sandbox provisioning": "complete"
      },
      "remediation": null,
      "durationMs": 2
    },
    "security.endpoint": {
      "id": "security.endpoint",
      "category": "security",
      "status": "warning",
      "summary": "endpoint protection detected; Codex exclusions are unverified",
      "details": {
        "Codex exclusions": "not verified",
        "endpoint products": "Microsoft Defender",
        "exclusion targets": "signed Codex app; codex.exe; codex-windows-sandbox-setup.exe; codex-command-runner.exe; codex-code-mode-host.exe"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "Microsoft Defender can interfere with Codex. Verify Codex exclusions.",
          "measured": "not verified",
          "expected": "Codex application and helper exclusions",
          "remedy": "Microsoft Defender: Add a certificate or executable-path exclusion for Codex and its helpers. If Attack Surface Reduction blocks Codex, add a rule exclusion. If Controlled Folder Access blocks Codex, allow the app.",
          "fields": [
            "Codex exclusions"
          ]
        }
      ],
      "remediation": "ask your security administrator to verify Codex exclusions and required helper allowances",
      "durationMs": 21
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "C:\\Users\\Vinicius\\.codex (dir)",
        "active rollout files": "10 files, 35018518 total bytes, 3501851 average bytes",
        "archived rollout files": "2 files, 216905 total bytes, 108452 average bytes",
        "goals DB": "C:\\Users\\Vinicius\\.codex\\goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "C:\\Users\\Vinicius\\.codex\\logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "C:\\Users\\Vinicius\\.codex\\log (dir)",
        "memories DB": "C:\\Users\\Vinicius\\.codex\\memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "memories v2 DB": "C:\\Users\\Vinicius\\.codex\\memories_v2_1.sqlite (missing)",
        "memories v2 DB integrity": "skipped (missing)",
        "queue DB": "C:\\Users\\Vinicius\\.codex\\queue_1.sqlite (file)",
        "queue DB integrity": "ok",
        "sqlite home": "C:\\Users\\Vinicius\\.codex (dir)",
        "standalone release cache": "1 entries in C:\\Users\\Vinicius\\.codex\\packages\\standalone\\releases",
        "state DB": "C:\\Users\\Vinicius\\.codex\\state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "C:\\Users\\Vinicius\\.codex\\thread_history_1.sqlite (file)",
        "thread history DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 106
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "10",
        "rollout DB active rows": "9",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "2",
        "rollout DB archived rows": "2",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread id sample": "01a0b98d-5109-7691-8bdd-70bef7aa5561",
        "rollout DB duplicate rollout thread ids": "1",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "1",
        "rollout DB missing active sample": "C:\\Users\\Vinicius\\.codex\\sessions\\2026\\09\\19\\rollout-2026-09-19T09-04-01-01a0b98d-5109-7691-8bdd-70bef7aa5561.jsonl",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=11",
        "rollout DB rows": "11",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "vscode=10, subagent:other=1",
        "rollout DB stale rows": "0"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "1 active, 0 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "duplicate thread inventory entries found",
          "measured": "1 duplicate rollout thread ids, 0 duplicate DB paths",
          "expected": "one rollout path and thread id per thread",
          "remedy": "Attach the doctor report to a bug report so support can inspect samples.",
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 20
    },
    "system.disk": {
      "id": "system.disk",
      "category": "disk",
      "status": "ok",
      "summary": "sufficient free disk space (87.5 GiB)",
      "details": {
        "CODEX_HOME available": "87.5 GiB",
        "failure threshold": "1.0 GiB",
        "warning threshold": "5.0 GiB",
        "worktree available": "87.5 GiB"
      },
      "remediation": null,
      "durationMs": 0
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en-US",
      "details": {
        "EDITOR": "not set",
        "VISUAL": "not set",
        "os": "Windows 10.0.26200 (Windows 11 Professional) [64-bit]",
        "os language": "en-US",
        "os type": "Windows",
        "os version": "10.0.26200"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "color output": "enabled",
        "console input code page": "850",
        "console output code page": "850",
        "stderr console mode": "0x00000007 (VT processing: true)",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout console mode": "0x00000007 (VT processing: true)",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "120x30"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "System32",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.157.0",
        "check for update on startup": "true",
        "last checked at": "2026-09-25T10:23:35.213538200Z",
        "latest version": "0.157.0",
        "latest version status": "current version is not older",
        "update action": "standalone installer",
        "version cache": "C:\\Users\\Vinicius\\.codex\\version.json"
      },
      "remediation": null,
      "durationMs": 1136
    }
  }
}

What issue are you seeing?

When I start Codex CLI normally on Windows using:

codex

Codex starts successfully, but two additional visible console windows open automatically.

The extra windows remain open while Codex is running.

The issue does not occur when I start Codex with:

codex --no-daemon

I inspected the running processes and found that the managed app-server daemon starts Node helper processes which receive visible conhost.exe instances.

Observed process tree:

codex.exe app-server --listen unix:// --managed-daemon
├─ node_repl.exe
│  └─ conhost.exe
└─ node.exe
   ├─ conhost.exe
   └─ node_repl.exe

The relevant daemon executable is:

~\.codex\packages\app-server-daemon\releases\0.157.0-x86_64-pc-windows-msvc\bin\codex.exe

The CLI itself works correctly. The problem appears to be that helper processes launched by the managed daemon receive visible console windows instead of running headless/in the background.

Using codex --no-daemon avoids the issue.



### What steps can reproduce the bug?

```markdown
1. Install Codex CLI 0.157.0 on Windows using the official standalone Windows installer.

2. Open a non-elevated PowerShell terminal.

3. Run:

```powershell
codex
Codex starts normally.
Two additional console windows open automatically.
Leave Codex and the two windows open and inspect the process tree. The managed daemon can be seen spawning node.exe / node_repl.exe processes with conhost.exe.
Exit Codex.
Start it again using:
codex --no-daemon
Codex starts without the two additional visible console windows.

The behavior is consistently reproducible with codex, while codex --no-daemon avoids it.


### What is the expected behavior?

Running:

```powershell
codex

should start the Codex CLI and its managed daemon without opening additional visible console windows.

Background helper processes such as node.exe, node_repl.exe, and their console hosts should run headlessly/hidden unless a visible terminal is explicitly required.



### Additional information


Esse campo é importante porque temos um diagnóstico bem melhor do que apenas "duas janelas aparecem". Coloque:

```markdown
I also inspected the Windows process tree while the issue was occurring.

The CLI process I launched was:

```text
C:\Users\<user>\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe

The shared managed daemon was running as:

codex.exe app-server --listen unix:// --managed-daemon

Its child processes included:

node_repl.exe
└─ conhost.exe

node.exe
├─ conhost.exe
└─ node_repl.exe

There are also other Codex app-server processes on the machine from the OpenAI/ChatGPT VS Code extension, but the visible console behavior correlates with the managed daemon.

The Codex CLI was installed using the official Windows installer:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

I originally also had the npm installation, but switched to the standalone installation. The behavior remained related to the managed daemon rather than the PATH/install method.

codex --no-daemon works without opening the extra windows.

I can provide additional process-tree output or test a patched build if needed.

Activity

  1. added
    bug
    on Sep 25, 2026
  2. added
    CLI
    windows-os
    app-server
    on Sep 25, 2026
  3. gggtwi commented on Sep 25, 2026

    @gggtwi

    I encountered the same issue when using codex-cli via cmd in VS Code, where Codex launched a bunch of visible cmd and PowerShell windows.

  4. gggtwi commented on Sep 25, 2026

    @gggtwi

    The following is the information provided by Codex.

    Title: Windows: codex-code-mode-host.exe briefly opens a visible terminal window during tool calls

    Description

    On Windows 11, Codex repeatedly opens a short-lived terminal window while running tools. The process shown in the window is codex-code-mode-host.exe from app-server daemon version 0.157.0.

    Steps to reproduce

    Use Codex on Windows.

    Trigger a tool call backed by the code mode host. A trivial functions.exec call containing only text("test") is sufficient.

    Observe a terminal window briefly appear on the desktop.

    Expected behavior

    Tool calls run without opening a visible terminal window.

    Actual behavior

    A terminal window briefly appears. This also happens when shell commands are run with tty: true. No cmd.exe or PowerShell command is needed to reproduce it.

    Environment

    Windows 11

    Codex app-server daemon 0.157.0

    Executable: C:\Users<user>.codex\packages\app-server-daemon\releases\0.157.0-x86_64-pc-windows-msvc\bin\codex-code-mode-host.exe

    Troubleshooting performed

    Confirmed that codex-code-mode-host.exe is launched by the app-server daemon’s codex.exe.

    Confirmed that the host executable uses the Windows console subsystem.

    Tested both Windows Terminal and Windows Console Host as the default terminal; the popup persisted. The original terminal setting was restored.

    Confirmed that setting tty: true on exec_command does not prevent the host window from appearing.

  5. yangda2024-cyber commented on Sep 25, 2026

    @yangda2024-cyber

    Additional Windows reproduction from an npm installation:

    • @openai/codex 0.157.0 on Windows; running plain codex from CMD opens several visible console windows, some of which close on their own. codex --no-daemon avoids the popups.
    • Attempting npm install -g @openai/[email protected] from PowerShell failed with EBUSY: resource busy or locked, copyfile while npm tried to move codex-code-mode-host.exe from the current package to a temporary .codex-* directory. This suggests a running Codex helper can also block an npm downgrade.

    Expected: plain codex should not create visible helper consoles, and helper processes should not leave the CLI package locked after exit.

  6. MarcusNeufeldt commented on Sep 25, 2026

    @MarcusNeufeldt

    Same here on Windows 11, Codex CLI 0.157.0 (standalone installer), Windows Terminal set as the default terminal.

    It's not just the node helpers. Every console child that the managed daemon (app-server --listen unix:// --managed-daemon) starts gets its own visible window:

    • Hooks: each hooks.json command runs as powershell.exe -NoProfile -Command "<hook>" with the daemon as parent. With PreToolUse/PostToolUse hooks configured, that's a window on every tool call. Each spawn is followed ~1s later by OpenConsole.exe -Embedding, i.e. the default-terminal handoff to Windows Terminal.
    • stdio MCP servers: when a session starts, the daemon launches all of them at once (node.exe, python.exe -m <server>, node_repl.exe, a .exe MCP server). I recorded 5 Windows Terminal windows titled with those executables within ~2s, plus a few more PseudoConsoleWindows.

    Shell tool calls (pwsh.exe from the bundled runtime) did not open a window in the same capture. So it looks like the hook runner and the MCP stdio launcher are missing CREATE_NO_WINDOW (or aren't inheriting a hidden console) when the parent is the detached daemon.

    What worked for me:

    • codex --no-daemon, or
    • [features] daemon_auto_start = false in config.toml, so new sessions don't auto-start the daemon.

    The downside is that I use remote control, which needs the daemon, so neither is a real fix for that setup.

  7. yhb8746779 commented on Sep 25, 2026

    @yhb8746779

    the same thing

  8. baburabbasi commented on Sep 25, 2026

    @baburabbasi

    I can reproduce this on Codex CLI 0.157.0 / Windows 11, launched from the VS Code integrated terminal inside a Git repository.

    My case appears to be a more severe variant of the visible-console regression:

    • During active Codex work, visible Windows Terminal / console windows can open and close roughly 2–3 times per second.
    • Some of the windows are completely blank and disappear almost immediately.
    • Others briefly show internal Git commands. One command I was able to capture was of the form:
    git -c safe.bareRepository=explicit -c core.hooksPath=NUL -c core.fsmonitor=false remote -v
    
    • One of the spawned windows displayed:
    [error 2147942632 (0x800700e8) when launching ...]
    
    • The behavior started immediately after updating to 0.157.0; I did not see this behavior before the update.
    • Codex itself continues working, but the repeated foreground windows cause severe screen flicker and disruption.
    • I have screenshots showing both a blank spawned window and another spawned window containing the Git command/error.

    I have not yet confirmed whether codex --no-daemon suppresses the issue in my setup.

    This may overlap with the managed-daemon console-window bug described here, but the rapid repeated Git/helper-window spawning during an active task seems worth noting because it is substantially more frequent than just two extra windows at startup.

    I can provide a short screen recording and additional diagnostics if useful.

  9. BANG404 commented on Sep 25, 2026

    @BANG404

    Additional reproduction on Windows 11 with a standard (non-elevated) PowerShell terminal.

    Environment:

    • Codex CLI: 0.156.1
    • Installation: Bun global install (bun pm ls -g --depth 0 reports @openai/[email protected])
    • Terminal: non-administrator Windows terminal

    When Codex starts and CUA/browser integration is active, one or more visible console windows are opened for the bundled helper:

    C:\Users\\<user>\\AppData\\Local\\OpenAI\\Codex\\runtimes\\cua_node\\13827bafdc0b5422\\bin\\node_repl.exe
    

    The path is listed as nodeReplPath in the generated chrome-native-hosts-v2.json native-host configuration. The helper is expected to run as a background/native-messaging process, but its console window becomes visible under a non-elevated launch. The Codex functionality otherwise continues to work.

    The behavior differs when launching from an elevated terminal, so this may be related to Windows console inheritance or missing hidden-window creation flags when the managed daemon/native host starts the helper.

    Expected: node_repl.exe and other non-interactive CUA helpers should not create visible console windows.

  10. brodrigz commented on Sep 25, 2026

    @brodrigz

    Reproducible on Windows 10 as well

  11. foxsalaf commented on Sep 26, 2026

    @foxsalaf

    Repro plus some detail on which two windows these are in a default install, and confirmation of the daemon_auto_start workaround.

    Environment: Windows 11 Pro N (10.0.26200), @openai/codex 0.157.0 from npm, launched as plain codex from cmd.exe. Codex desktop app installed but not running. No user-defined MCP servers apart from what the desktop app writes into config.toml.

    Symptom: two console windows appear a few seconds after every TUI start, titled …\AppData\Local\OpenAI\Codex\runtimes\cua_node\<hash>\bin\node_repl.exe and …\bin\node.exe. They stay open for the whole session and come back when closed.

    Process tree (Win32_Process): both windows belong to children of codex.exe app-server --listen unix:// --managed-daemon, which itself has no console. They are exactly the two stdio MCP servers a default install has:

    1. mcp_servers.node_repl in config.toml (written by the desktop app) → node_repl.exe
    2. cua_repl from the bundled plugin unified-computer-use@openai-bundled (plugins/cache/openai-bundled/unified-computer-use/26.908.70816/.mcp.json) → node.exe …\@oai\cua-repl\bin\cua-repl.mjs (this one spawns a second node_repl.exe that shares its console, so it does not add a third window)

    So, unlike the observation in #48023, direct .exe launches also get a window here. The deciding factor is not .cmd vs .exe: the detached daemon has no console, so every console-subsystem child allocates its own. Setting enabled = false on node_repl only removes one of the two windows.

    Workaround confirmed:

    codex features disable daemon_auto_start   # writes [features] daemon_auto_start = false
    codex app-server daemon stop
    

    On the next codex start there is no app-server process, and the very same two MCP servers run as children of the TUI codex.exe with MainWindowHandle = 0, i.e. no window (checked with Get-Process). --no-daemon gives the same result, as noted above.

    Minor: codex app-server daemon stop returned {"status":"stopped"} but left the codex.exe app-server daemon pid-update-loop process running; it had to be killed by hand.

  12. missingus3r commented on Sep 26, 2026

    @missingus3r

    Same issue here

  13. DreamEnding commented on Sep 26, 2026

    @DreamEnding

    Same issue here

  14. xhocquet commented on Sep 26, 2026

    @xhocquet

    Also seeing this, how was this not caught in tests? Really sloppy.

  15. mars70s commented on Sep 27, 2026

    @mars70s

    Possibly related additional data point from Codex CLI 0.157.1 on Windows 11 x64.

    Environment:

    • Codex CLI: 0.157.1
    • Windows sandbox: sandbox = "unelevated"
    • PowerShell 7
    • Git repository was clean

    During a Codex session, a Git subprocess failed to launch with:

    [error 2147942632 (0x800700e8) when launching
    '"git" -c safe.bareRepository=explicit -c core.hooksPath=NUL -c core.fsmonitor=false remote -v']

    I then tested the same repository directly from PowerShell.

    The following all succeeded with exit code 0:

    • git rev-parse HEAD
    • git status --short
    • git remote -v
    • the exact Codex-wrapped command:
      git -c safe.bareRepository=explicit -c core.hooksPath=NUL -c core.fsmonitor=false remote -v

    So I found no indication that the repository, Git executable, or command arguments themselves were failing.

    I have also seen the same 0x800700e8 process-launch error previously with a different Git subcommand (git rev-parse HEAD).

    I exited the Codex CLI and started it again. Immediately after restart, I ran the same three read-only diagnostics from Codex and all completed successfully. The failure did not reproduce on that single post-restart test.

    So my current observation is:

    • recurring 0x800700e8 across more than one Git subcommand
    • direct PowerShell execution succeeds
    • immediate reproduction after restarting the Codex CLI: no
    • exact root cause: not established

    This may indicate a transient/session-state-dependent Windows subprocess-launch problem, but I do not have enough evidence to say it is the same root cause as the visible-console-window issue.

    I preserved the local diagnostic outputs and SHA-256 hashes if additional details would be useful.

  16. thornos78 commented on Sep 27, 2026

    @thornos78

    Additional Windows reproduction on 2026-09-27, from a Codex Desktop task using the managed PowerShell-capable command path:

    When new task messages/tool work started, visible console windows recurred intermittently. A 60-second process watch after the normal managed-daemon bootstrap recorded 28 relevant process starts and 2 foreground-owner changes. Captured chains included the Codex-managed daemon starting git.exe and codex-windows-sandbox-setup.exe with conhost.exe, and codex-command-runner → pwsh.exe → conhost.exe, followed by visible Windows Terminal/OpenConsole activity. A hidden-daemon workaround avoided windows in one test but did not survive the normal managed bootstrap reliably.

    This suggests the issue is in Codex's Windows managed-helper/console launch path rather than a PowerShell profile alone; the exact root cause remains unconfirmed. Please cross-reference the related daemon/helper and code-mode-host reports, and clarify the supported workaround or fixed version.

    Repeated reproduction and diagnosis of this apparent product bug consumed a substantial amount of our included Codex usage. We are also requesting an account-usage review and a one-time reset/credit if any goodwill adjustment is available.

  17. Tinywan commented on Sep 28, 2026

    @Tinywan

    Same issue here

  18. Tinywan commented on Sep 28, 2026

    @Tinywan

    • 对,daemon_auto_start = false 不等于默认添加 --no-daemon。当前版本没有 config.toml 对应项。

    你已经有 codex 包装函数,编辑:

    C:\Users\tinywan\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

    把第 23 行从:

    & "C:\Users\tinywan\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe" @Args

    改成:

    & "C:\Users\tinywan\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe" --no-daemon @Args

    完整函数为:

    function codex {
    Sync-AiSkillsQuietly
    & "C:\Users\tinywan\AppData\Local\Programs\OpenAI\Codex\bin\codex.exe" --no-daemon @Args
    }

    保存后重新加载:

    . $PROFILE

    以后直接执行:

    codex

    实际就相当于:

    codex.exe --no-daemon

  19. etraut-openai commented on Sep 29, 2026

    @etraut-openai
    Contributor

    We're using #48074 to track this issue, and we're working on a fix. Version 0.158.0 contains a partial fix, but some users are still seeing the problem. We've identified a few additional code paths that require the same fix. I'll post updates to #48074.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions