Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.154.0 (standalone installation)
What subscription do you have?
ChatGPT Pro (20x)
Which model were you using?
N/A — failure occurs during daemon startup, before model interaction.
What platform is your computer?
Windows 11 Professional, build 10.0.26200, x64. Modern Standby supported; DAM is running.
What terminal emulator and version are you using (if applicable)?
Windows Console Host (conhost.exe) 10.0.26100.8875; Windows PowerShell (powershell.exe file version 10.0.26100.8875); also reproduced with -NoProfile; no multiplexer.
Codex doctor report
{
"schemaVersion": 1,
"generatedAt": "1789037897s since unix epoch",
"overallStatus": "warning",
"codexVersion": "0.154.0",
"checks": {
"app_server.status": {
"id": "app_server.status",
"category": "app-server",
"status": "ok",
"summary": "background server is not running",
"details": {
"control socket": "C:\\Users\\<USER>\\.codex\\app-server-control\\app-server-control.sock",
"daemon state dir": "C:\\Users\\<USER>\\.codex\\app-server-daemon",
"mode": "ephemeral",
"pid file": "C:\\Users\\<USER>\\.codex\\app-server-daemon\\app-server.pid (missing)",
"settings": "C:\\Users\\<USER>\\.codex\\app-server-daemon\\settings.json (missing)",
"status": "not running",
"update-loop pid file": "C:\\Users\\<USER>\\.codex\\app-server-daemon\\app-server-updater.pid (missing)"
},
"remediation": null,
"durationMs": 0
},
"auth.credentials": {
"id": "auth.credentials",
"category": "auth",
"status": "ok",
"summary": "auth is configured",
"details": {
"auth file": "C:\\Users\\<USER>\\.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\\<USER>\\.codex",
"active thread overrides": "not inspected",
"config.toml": "C:\\Users\\<USER>\\.codex\\config.toml",
"config.toml parse": "ok",
"configuration load ms": "5",
"configuration scope": "invocation config, including cloud-managed policy",
"cwd": "C:\\Users\\<USER>",
"enabled feature flags": "<redacted>",
"feature flag overrides": "prevent_idle_sleep=true",
"feature flags enabled": "50",
"log dir": "C:\\Users\\<USER>\\.codex\\log",
"mcp servers": "5",
"model": "gpt-6-astra",
"model provider": "openai",
"sqlite home": "C:\\Users\\<USER>\\.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.901.6511.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": 8
},
"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\\<USER>\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
"current executable": "C:\\Users\\<USER>\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
"install context": "standalone (windows, package C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc, bin C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.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": 6
},
"mcp.config": {
"id": "mcp.config",
"category": "mcp",
"status": "ok",
"summary": "MCP configuration is locally consistent",
"details": {
"configured servers": "5",
"disabled servers": "2",
"stdio servers": "3",
"streamable_http servers": "2"
},
"remediation": null,
"durationMs": 338
},
"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": 327
},
"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": 784
},
"runtime.provenance": {
"id": "runtime.provenance",
"category": "runtime",
"status": "ok",
"summary": "running standalone on windows-x86_64",
"details": {
"commit": "unknown",
"current executable": "C:\\Users\\<USER>\\AppData\\Local\\Programs\\OpenAI\\Codex\\bin\\codex.exe",
"install method": "standalone (windows, package C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc, bin C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\bin, resources C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\codex-resources, path C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\codex-path)",
"platform": "windows-x86_64",
"version": "0.154.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\\<USER>\\.codex\\packages\\standalone\\releases\\0.154.0-x86_64-pc-windows-msvc\\codex-path\\rg.exe",
"search command readiness": "file exists",
"search provider": "bundled"
},
"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": 1
},
"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": 24
},
"state.paths": {
"id": "state.paths",
"category": "state",
"status": "ok",
"summary": "state paths and databases are inspectable",
"details": {
"CODEX_HOME": "C:\\Users\\<USER>\\.codex (dir)",
"active rollout files": "394 files, 6921941893 total bytes, 17568380 average bytes",
"archived rollout files": "0 files, 0 total bytes, 0 average bytes",
"goals DB": "C:\\Users\\<USER>\\.codex\\goals_1.sqlite (file)",
"goals DB integrity": "ok",
"log DB": "C:\\Users\\<USER>\\.codex\\logs_2.sqlite (file)",
"log DB integrity": "ok",
"log dir": "C:\\Users\\<USER>\\.codex\\log (dir)",
"memories DB": "C:\\Users\\<USER>\\.codex\\memories_1.sqlite (file)",
"memories DB integrity": "ok",
"queue DB": "C:\\Users\\<USER>\\.codex\\queue_1.sqlite (file)",
"queue DB integrity": "ok",
"sqlite home": "C:\\Users\\<USER>\\.codex (dir)",
"standalone release cache": "1 entries in C:\\Users\\<USER>\\.codex\\packages\\standalone\\releases",
"state DB": "C:\\Users\\<USER>\\.codex\\state_5.sqlite (file)",
"state DB integrity": "ok",
"thread history DB": "C:\\Users\\<USER>\\.codex\\thread_history_1.sqlite (file)",
"thread history DB integrity": "ok"
},
"remediation": null,
"durationMs": 1252
},
"state.rollout_db_parity": {
"id": "state.rollout_db_parity",
"category": "threads",
"status": "ok",
"summary": "rollout files and state DB thread inventory agree",
"details": {
"default model provider": "openai",
"rollout DB active files": "394",
"rollout DB active rows": "394",
"rollout DB archive mismatches": "0",
"rollout DB archived files": "0",
"rollout DB archived rows": "0",
"rollout DB duplicate DB paths": "0",
"rollout DB duplicate rollout thread ids": "0",
"rollout DB malformed file names": "0",
"rollout DB missing active rows": "0",
"rollout DB missing archived rows": "0",
"rollout DB model providers": "openai=394",
"rollout DB rows": "394",
"rollout DB scan cap reached": "false",
"rollout DB scan errors": "0",
"rollout DB sources": "cli=206, subagent:other=181, vscode=4, exec=2, subagent:thread_spawn=1",
"rollout DB stale rows": "0"
},
"remediation": null,
"durationMs": 160
},
"system.disk": {
"id": "system.disk",
"category": "disk",
"status": "ok",
"summary": "sufficient free disk space (1064.2 GiB)",
"details": {
"CODEX_HOME available": "1064.2 GiB",
"failure threshold": "1.0 GiB",
"warning threshold": "5.0 GiB",
"worktree available": "1064.2 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": {
"WT_SESSION": "present",
"color output": "disabled (stdout is not a terminal)",
"console input code page": "850",
"console output code page": "65001",
"stderr console mode": "0x00000007 (VT processing: true)",
"stderr is terminal": "true",
"stdin is terminal": "true",
"stdout console mode": "unavailable",
"stdout is terminal": "false",
"terminal": "Windows Terminal",
"terminal size": "148x43"
},
"remediation": null,
"durationMs": 0
},
"terminal.title": {
"id": "terminal.title",
"category": "title",
"status": "ok",
"summary": "terminal title configured",
"details": {
"terminal title activity": "true",
"terminal title items": "activity, project-name",
"terminal title project source": "cwd",
"terminal title project value": "<USER>",
"terminal title source": "configured"
},
"remediation": null,
"durationMs": 0
},
"updates.status": {
"id": "updates.status",
"category": "updates",
"status": "ok",
"summary": "update configuration is locally consistent",
"details": {
"cached latest version": "0.154.0",
"check for update on startup": "true",
"desktop application": "OpenAI.Codex",
"desktop latest build": "26.903.9818.0",
"desktop update status": "available",
"dismissed version": "0.136.0",
"last checked at": "2026-09-10T09:48:09.822567800Z",
"latest version": "0.154.0",
"latest version status": "current version is not older",
"update action": "standalone installer",
"version cache": "C:\\Users\\<USER>\\.codex\\version.json"
},
"remediation": null,
"durationMs": 454
}
}
}What issue are you seeing?
Codex CLI 0.154.0 (standalone) cannot start the background server on Windows 11. It reports:
Error: host Job Object prevents daemon detachment; start from a host that allows breakaway
What steps can reproduce the bug?
-
Open PowerShell as a regular user.
-
Run:
codex app-server daemon start -
The command fails with the Job Object error.
Also reproduced with PowerShell -NoProfile.
What is the expected behavior?
The background server starts successfully and continues running after the terminal is closed.
Additional information
The error is returned when in_job != 0 in windows.rs.
A separate native probe using CREATE_SUSPENDED | DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB successfully creates and runs a child process. The child remains in a Job Object. Its immediate job has flags 0x1800:
BREAKAWAY_OK: enabledSILENT_BREAKAWAY_OK: enabledKILL_ON_JOB_CLOSE: disabled
The machine supports Modern Standby, and Desktop Activity Moderator (DAM) is running. DAM may explain why the process remains in a job, but this has not been confirmed.
Activity
84dnnvbdvp-debug commentedon Sep 10, 2026
One distinction seems important before treating
IsProcessInJob(...)=TRUEas proof that this host cannot support a daemon.Current
ensure_detached_launch()already launches the probe withCREATE_BREAKAWAY_FROM_JOB, then rejects it solely because the child is still in some job. Windows' nested-job rules explicitly allow a breakaway child to leave the immediate job and successive parents only until it reaches a parent that does not permit breakaway: https://learn.microsoft.com/en-us/windows/win32/procthread/nested-jobs. So residual membership after a successfulCREATE_BREAKAWAY_FROM_JOBis a valid nested-job outcome, not by itself evidence that the child's lifetime is still coupled to the launcher.The useful next discriminator may be lifecycle rather than membership: with the same native probe, let the launcher exit and verify from a separate observer whether the child actually survives. Pair that with a control where the residual job has
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, which Microsoft documents as terminating associated processes when the last job handle closes: https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects. If the Modern Standby/DAM case remainsin_job != 0but survives launcher/terminal exit, the current guard is rejecting a benign residual association. If it dies, the existing refusal is doing real work and the remaining job/ancestor limits are the place to inspect.That regression would also avoid assuming
KILL_ON_JOB_CLOSEis the only relevant limit; jobs can impose other constraints. The narrower claim is just thatIsProcessInJob(NULL)answers membership, while the daemon requirement is really about whether the residual job chain makes independent lifetime unsafe.etraut-openai commentedon Sep 10, 2026
(response written by codex)
Thanks for the detailed report. The current code rejects a child that remains in any Job Object, both during the launch probe and after the actual daemon starts. Windows permits residual job membership after breakaway, so that check alone doesn’t establish that the daemon cannot survive terminal closure.
Could you share the native probe source and check whether its child survives both launcher exit and closing the terminal, using a separate observer? The reported
0x1800flags describe the immediate job; they don’t rule out restrictions in ancestor jobs.That would help confirm whether we’re rejecting a harmless system-managed job and provide a regression case. DAM is a plausible explanation, but its involvement is still unconfirmed.
hdegani17 commentedon Sep 17, 2026
I am also affected by this on Windows x64 with the official standalone Codex CLI 0.154.0 (tested on 2026-09-16).
Running
codex agentsfails with:The error also occurs in an independent PowerShell window opened from the Windows Start menu. Command resolution was checked: the standalone
codex.exetakes precedence over the older npm installation, andcodex --versionreportscodex-cli 0.154.0.codex doctorfound the standalone installation consistent.Additional diagnostic observations:
0x1800:BREAKAWAY_OKandSILENT_BREAKAWAY_OKenabled,KILL_ON_JOB_CLOSEdisabled.CREATE_SUSPENDED | DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOBwere created successfully but still reported Job Object membership. The suspended diagnostic children were then terminated; this was not a lifecycle/survival test.Starting a foreground server with
codex app-server --listen ws://127.0.0.1:48763and connecting withcodex agents --remote ws://127.0.0.1:48763works on this machine. This is only a workaround; native daemon startup remains blocked.Adding this as another reproduction of the issue. Is there a planned fix or a supported diagnostic procedure to distinguish a benign residual Job Object association from a lifetime restriction, without weakening Windows security settings?
moe-cyborg commentedon Sep 17, 2026
Additional reproduction
I can reproduce the same failure on another Windows 11 system.
Environment
22631, 64-bit7.6.5(Core)ConsoleHost26.911.7940.00.155.0-alpha.2.60.154.0S0 Low Power Idle)The managed standalone installation is present at:
and
Test-PathreturnsTrue.Observed behavior
ChatGPT Desktop has:
Settings → Connections → Control this PC → Allow connectionsenabled.
On mobile, Remote pairing fails both by:
Normal ChatGPT conversation sync works in the same Personal workspace.
Both Remote daemon entry points fail with the same error.
Standalone
0.154.0:Desktop-bundled
0.155.0-alpha.2.6:Both return:
This adds a reproduction on Windows 11 build
22631, and confirms that the same Job Object failure occurs with both the official standalone0.154.0CLI and the Desktop-bundled0.155.0-alpha.2.6CLI.In this environment, the daemon startup failure also coincides with the user-visible Remote pairing failure described above.
I do not have evidence that Modern Standby/DAM is the root cause.
nobodynose1 commentedon Sep 24, 2026
Third independent reproduction — with a session-0 data point that may rule out the DAM hypothesis
I can reproduce this on another machine and can add a data point that I think argues against the
Desktop Activity Moderator being the cause.
Environment
10.0.26100, x64, OS language zh-CNpowercfg /a→Standby (S0 Low Power Idle) - Network connecteddamdriver present and running (Status = Running,StartType = System)0.155.0-alpha.16.3(desktop-bundled) and0.156.1(managed daemon package)Entry points that fail identically
All three return
Error: host Job Object prevents daemon detachment; start from a host that allows breakaway.Hosts tried — identical immediate-job flags in every case
inJobLimitFlags0x1800cmd.exelaunched byexplorer.exe(Start-Process explorer.exe <file>.cmd)0x18000x1800services.exe0x1800In all four:
BREAKAWAY_OK = true,SILENT_BREAKAWAY_OK = true,KILL_ON_JOB_CLOSE = false.Host #4 is the interesting one. It ran in session 0, in the chain
powershell.exe → powershell.exe → svchost.exe → services.exe → wininit.exe.There is no desktop in session 0, so a Desktop Activity Moderator job cannot explain the
association there — and the flags come out byte-identical to the interactive session.
Native probe
Using
CREATE_SUSPENDED | DETACHED_PROCESS | CREATE_BREAKAWAY_FROM_JOB(the same combinationensure_detached_launchuses), the spawn always succeeds — noERROR_ACCESS_DENIED— butIsProcessInJob(child, NULL, &in_job)returns true in every case. I also tried addingCREATE_NEW_PROCESS_GROUPandCREATE_NO_WINDOW; same result. This matches the original report.Note the parent's immediate job is
0x1800, i.e.SILENT_BREAKAWAY_OKis already set, yet the childis still associated with a job. Combined with the absence of
ERROR_ACCESS_DENIED, that reads asan unnamed, system-wide job that every process inherits, rather than a session/desktop-scoped one.
Two other things that may be useful
CODEX_HOME(noconfig.toml, noauth.json) produces the identical JobObject error, confirming the guard is evaluated before any config or provider is loaded.
Error: this CLI has no complete local package; install a packaged Codex CLI or use the standalone installer.Installing the daemon package via the installer's
CODEX_INSTALL_DAEMON_ONLY=1path resolved thatone, but the Job Object error is unaffected. Worth separating if others report both.
On the proposed survival test
I'm happy to run a launcher-exit / terminal-close survival test with a separate observer if you can
describe the observer you'd like. One caveat: the guard appears twice —
ensure_detached_launch(the suspended probe) andProcess::ensure_detachedafter the real spawn,the latter calling
self.terminate()before bailing. A survival result would characterise theresidual job's lifetime, but the launch would still be refused before any daemon survives to be
observed, unless one of the two guards is relaxed.
SilverKnight95 commentedon Sep 25, 2026
I can reproduce this issue on Codex CLI 0.157.0 using the npm installation on Windows 11 Pro.
Environment:
Reproduction steps:
Launch Codex from an elevated terminal.
codex.cmd
Codex correctly refuses to start the daemon:
Error: start the Windows daemon from a non-elevated terminal; shared clients must not inherit administrator privileges
Open a new non-elevated Windows PowerShell terminal.
Verify that the terminal is not elevated. The administrator-role check returns:
False
Run:
codex.cmd
Codex begins installing the daemon:
Installing daemon from CLI version 0.157.0 into C:\Users<USER>.codex\packages\app-server-daemon...
It then fails with:
Error: host Job Object prevents daemon detachment; start from a host that allows breakaway
Run the suggested workaround:
codex.cmd --no-daemon
Result:
Codex successfully launches and reaches the Folder Access / "Trust this folder?" screen when using --no-daemon.
This confirms the Job Object daemon-detachment issue is still reproducible in Codex CLI 0.157.0 with the npm distribution, while the CLI itself works when the background daemon is bypassed.
nobodynose1 commentedon Sep 25, 2026
Relaxing both guards: the daemon does start and register
Following up on the
0x1800data point with a direct test of what the guard is actually protecting against.Method. I temporarily made both
IsProcessInJobchecks no-ops with a 2-byte import-table (ILT) edit, redirecting theIsProcessInJobimport toGetCurrentProcess— same DLL, takes no arguments, no side effects, returnsHANDLE(-1):IsProcessInJob(...) == 0is never true, so the first check never returnsErr0andif in_job != 0 { bail! }is never takenNo code bytes are modified.
IsProcessInJobhas exactly two call sites in the binary (ensure_detached_launchandProcess::ensure_detached), so the spawn /kill()/wait()/terminate()paths are left intact.Result. With both guards inert, the daemon starts and registers with the relay. That is the first time any of
codex app-server daemon start/codex remote-control startproduced a running daemon on this machine — the residual job membership did not tear it down.To be precise about what this does and does not show: it is not the observer-based survival test you asked for. I did not separately instrument "launcher exits → terminal closes → is the child still alive". What it does show is that residual job membership is not by itself fatal to the daemon, which is the narrower question of whether that check rejects a benign association.
Cleanup. This was diagnostic only. The installation has been restored to the unmodified
codex.exe, and the patch is version-specific, so I would not suggest it as a workaround.A second blocker, probably unrelated. With the daemon up, remote-control still fails to connect:
chatgpt.com's resolved addresses — none to the configured local proxy (127.0.0.1:7897).HTTPS_PROXY(pointed at a dead port, as a differential) andfeatures.respect_system_proxy=true(both via-cand as a direct process argument) change nothing.http-client/src/outbound_proxy.rscarries proxy handling for the main HTTP client, while the remote-control WS builds its own socket inapp-server-transport/.../remote_control/websocket.rs.On this machine
chatgpt.comalso resolves into Meta address space (31.13.64.0/18,2a03:2880::/32), so I cannot currently separate "the WS transport ignores the proxy" from "that path was never exercised because DNS is poisoned". If it reproduces for anyone else, it may deserve its own issue.daniel-lightfury commentedon Sep 25, 2026
Reproduced on Codex 0.157.0, Windows 11 build 26200.
Occurs in non-elevated PowerShell and WezTerm, including after a full restart.
Native Windows diagnostics:
Codex still reports:
"host Job Object prevents daemon detachment; start from a host that allows breakaway"
p-poppe commentedon Sep 25, 2026
Answering the survival question from @etraut-openai with a native probe (Codex 0.157.0 npm, Windows 11 Pro 26200 x64, Modern Standby, PowerShell 7 — same result from wmux and other hosts).
Context: the residual
0x1800job (BREAKAWAY_OK | SILENT_BREAKAWAY_OK, noKILL_ON_JOB_CLOSE) isn't created by the terminal. On this machineexplorer.exe, Outlook, Edge, Windows Terminal andsihost.exeare all in it, so every process started from the desktop inherits it.Probe: it simulates a terminal that kills its tree on close. The process creates its own job with
KILL_ON_JOB_CLOSE | BREAKAWAY_OK(nested under the desktop job), assigns itself to that job, spawns twoping -n 20children and exits:IsProcessInJobright after spawnDETACHED_PROCESS | CREATE_NO_WINDOW(control)DETACHED_PROCESS | CREATE_NO_WINDOW | CREATE_BREAKAWAY_FROM_JOBSo breakaway really does escape the terminal's job; the child is only still in the desktop's
0x1800job, which never kills anything.IsProcessInJob == trueafter breakaway doesn't mean the daemon will die with the terminal. On Windows 11 26200 it is always true for desktop-launched processes, which makes the current check reject every host.Suggestion: instead of rejecting any residual membership, check whether the child's remaining job would kill it (
JOBOBJECT_EXTENDED_LIMIT_INFORMATION.LimitFlags & JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, queried viaQueryInformationJobObject(NULL, …)from inside the child). Alternatively, fall back to--no-daemonwith a warning instead of exiting.Probe source (PowerShell + inline C#)
aalsanie commentedon Sep 25, 2026
I went through the current Windows daemon path and the documented nested job semantics. I think the reason this started affecting ordinary launches is #47179, which made
daemon_auto_startstable and enabled by default exposing the existing windows daemon-launch failure during new/resume/fork.There are two checks.
codex-rs/app-server-daemon/src/backend/windows.rs::ensure_detached_launch()launches a suspended probe using:It then calls:
and rejects the launch whenever
in_job != 0.The real daemon is then launched in
backend/pid_start.rswith:and
Process::ensure_detached()performs the same check after spawn, terminating the daemon if it still belongs to any Job Object; the important thing is thatIsProcessInJob(process, NULL)doesn't means this procss still associated with the job object whose lifetime is tied to this terminal.The survival probe posted here already gives:
KILL_ON_JOB_CLOSE | BREAKAWAY_OK;CREATE_BREAKAWAY_FROM_JOBdies when that job closes;CREATE_BREAKAWAY_FROM_JOBsurvives;truefromIsProcessInJob.so for that case:
won't guarantee child is still lifetime coupled to the launcher. The failure is not described as “the host does not allow daemon detachment”; the relevant breakaway succeeded, but codex rejects the child because some job object association remains. I do not think simply deleting the two
IsProcessInJobchecks is a correct general fix, windows nested-job semantics say that when a process has a chain of jobs, breakaway proceeds upward only until it reaches a job that does not allow further breakaway and the child can succssfully be created and still remain associated with that job and its ancestors.For example:
A daemon created with
CREATE_BREAKAWAY_FROM_JOBcan leave the inner job but remain in the outer job.In that case:
both of these predictes are wrong:
and:
Checking only
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSEonQueryInformationJobObject(NULL, ...)is not a complete gurantee either. For nested jobs,NULLqueries the process's immediate job; it does not enumerate the complete ancestor job chain.I would avoid a patch that removes
ensure_detached()or changesin_job != 0into a limit-flag check; before changing the launcher. More like:KILL_ON_JOB_CLOSE | BREAKAWAY_OKjob and there is a benign outer association then breakaway child survives closing the inner job even thoughIsProcessInJob(..., NULL)remains true.The documented job object APIs do not give the caller a way to enumerate and prove the safety of the full ancestor job chain, I suspect the windows solution will need to establish same user, nonelevated launch context rather than attempt to infer safety from the remaining job membership. I would also avoid attributing this specifically to modern standby/DAM. The additional session-0 reproduction in this issue shows the same
0x1800association outside an interactive desktop session.adityarya24 commentedon Sep 25, 2026
Same here after updating to codex-cli 0.157.0. Windows 11 (build 26200), Dell laptop with Modern Standby (S0 low power idle, no S3). Plain
codexfrom PowerShell fails with "host Job Object prevents daemon detachment; start from a host that allows breakaway".--no-daemonworks as a workaround. It started right after the update; the same terminal worked on the previous version.gologames commentedon Sep 25, 2026
@etraut-openai I ran the survival test you requested: launched
ping.exewithCREATE_BREAKAWAY_FROM_JOB, let the launcher exit, then closed the launching terminal. A separate observer verified the child's PID and creation time and confirmed that the same process remained alive and continued writing to its log, despite still belonging to a Job Object. In a separate control, closing the last handle to a Job withKILL_ON_JOB_CLOSEterminated its child.Source for this survival test and control (remove
.txtfrom both filenames and keep them together):I also tested whether checking only the immediate Job's
KILL_ON_JOB_CLOSEflag would be sufficient. This nested-job experiment showed that it would not:The child escaped the inner Job but remained in the middle and outer Jobs. Closing the outer Job terminated it, even though its immediate Job had no
KILL_ON_JOB_CLOSE.Based on these results, I implemented a fallback using a temporary WMI-created parent and the original caller's token: gologames#1
The patched daemon survived terminal closure and supported restart, a CLI conversation, and shutdown. Clippy and all 53 tests passed for the affected packages. The PR includes the investigation and implementation details.
SantosJMM commentedon Sep 25, 2026
Hello, I'm having the same problem with Windows 11 25H2. I’d like to add that when I run the command
codex --sandbox workspace-write --ask-for-approval on-request --model gpt-6-luna --config ‘model_reasoning_effort=“high”’ --cd .codex opens without needing to enable the--no-daemonflag, but if I simply runcodex, it throws the error and suggests the flag.Note: This was translated; I apologize if it doesn’t make much sense because of that. I just hope you understand the behavior I’m trying to report.
aalsanie commentedon Sep 25, 2026
'model_reasoning_effort="high"' makes Codex use the embedded app-server instead of the shared daemon, so it never hits the windows job object detachment failure.
@gologames your PR is close to a fix; it implements most of the points I mentioned earlier. What is still missing is automated regression coverage for the three job object cases discussed above and avoiding the initial real daemon spawn before the fallback decision.
With those covered, this looks much closer to a complete fix.
gologames commentedon Sep 25, 2026
@aalsanie Your suggestions sound reasonable. At the same time, I tried to keep the changes in this PR as small and focused as possible.
I’m happy to make further changes if @etraut-openai or other OpenAI maintainers request them.
aalsanie commentedon Sep 25, 2026
Since #47179 enabled daemon auto-start by default, this is no longer limited to an explicit app server daemon start. It affects normal startup paths including new sessions, resume, and fork.
I don’t think the impact on Windows users is fully obvious yet: anyone hitting this Job Object behavior is forced to run with --no-daemon just to use Codex normally. I think this needs a quick maintainer fix and release, but that’s just my two cents.
etraut-openai commentedon Sep 25, 2026
We have a fix in place for this. It will be included in the next release.
goodman-oai commentedon Nov 16, 2026
Fixed in Codex CLI 0.157.1 by #48157. Windows could start a daemon that escaped the inner Job Object, but Codex rejected it because it still belonged to the outer job. The released regression test verifies that the daemon reaches readiness in that configuration. Hotfix confirmation