Repository navigation
Description
Summary
On Windows the Codex sandbox runs commands as a separate local user account (CodexSandboxOffline / CodexSandboxOnline, members of CodexSandboxUsers). The Orca runtime's named pipe grants that account read access but not write, so the CLI's connect() fails with EPERM.
The CLI then discards the errno, and because the Orca PID is still visible to the sandbox user, classifies the live runtime as state: "starting" — permanently.
There are two independent defects here, either of which is fixable on its own. They are filed together because the second is only demonstrably harmful in the presence of the first; happy to split into two issues if you'd prefer separate tracking.
Impact
A supervised worker can complete its task successfully but cannot deliver worker_done. Because the CLI converts the named-pipe EPERM into runtime_unavailable and then reports the live runtime as starting, coordinators may wait indefinitely for a runtime that is already fully healthy.
This is not merely a diagnostics problem: starting is indistinguishable from a runtime that is still booting, so the correct client behaviour — keep waiting — is exactly the behaviour that hangs forever.
Proof: same live pipe, two identities
Probe is net.createConnection() against the running runtime's pipe, executed twice against the same pipe within the same minute.
inside codex exec --sandbox read-only |
control, outside sandbox | |
|---|---|---|
whoami |
nathanpc\codexsandboxoffline |
nathanpc\flami |
| pipe connect | EPERM syscall=connect errno=-4048 |
CONNECTED |
orca status runtime state |
"starting", reachable: false |
"ready", reachable: true |
Sandbox:
PROBE_PIPE=\\.\pipe\orca-21872-b5ca
PIPE_RESULT=ERROR code=EPERM syscall=connect errno=-4048
Control:
PROBE_PIPE=\\.\pipe\orca-21872-b5ca
PIPE_RESULT=CONNECTED
orca status --json inside the sandbox — note app.running: true with the correct PID, so metadata discovery is working; only the transport fails:
{
"id": "local-status", "ok": true,
"result": {
"app": { "running": true, "pid": 21872 },
"runtime": { "state": "starting", "reachable": false, "runtimeId": null },
"graph": { "state": "starting" }
},
"_meta": { "runtimeId": "none" }
}Control at the same moment returns "state": "ready", reachable: true, runtimeId: "b5ca6fa7-…", appVersion: "1.4.178".
Defect 1 — the pipe DACL excludes the sandbox principal
Live DACL of \\.\pipe\orca-21872-b5ca, read via GetSecurityInfo on an open handle (owner/group elided; machine SID redacted):
D:(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;S-1-5-21-...-1001)(A;;FR;;;WD)(A;;FR;;;AN)
SYSTEM, Administrators and the owning user get full access. Everyone (WD) and Anonymous (AN) get FR — read only, no FILE_WRITE_DATA — so a duplex client opening with GENERIC_READ | GENERIC_WRITE is denied.
Note that nobody chose this DACL. libuv passes NULL for lpSecurityAttributes to CreateNamedPipeW, so the object receives Windows' documented default named-pipe security descriptor: full control to LocalSystem, administrators and the creator-owner, plus read access to Everyone and the anonymous account. That is exactly, ACE for ACE, what is observed above. The runtime pipe is an object that needs a non-default descriptor and is currently getting the platform default.
Filesystem access is not the problem. Orca already grants the sandbox identity access to %APPDATA%\orca and orca-runtime.json (CodexSandboxUsers: Modify, Synchronize), recorded in windows-acl-grant.json. Discovery succeeds; only the IPC connect fails.
Defect 2 — permission-denied connect is mapped to permanent starting
src/cli/runtime/transport.ts replaces every socket error with a fixed message, discarding the errno:
socket.once('error', () => {
finish({ ok: false, error: new RuntimeClientError(
'runtime_unavailable',
'Could not connect to the running Orca app. Restart Orca and try again.') });
});The suggested remedy cannot work — a restart recreates the pipe with the same DACL.
src/cli/runtime/status.ts then classifies on liveness alone:
catch {
const running = isProcessRunning(metadata.pid);
return buildCliStatusResponse({
app: { running, pid: running ? metadata.pid : null },
runtime: {
state: running ? 'starting' : 'stale_bootstrap',
reachable: false,
runtimeId: null
},
graph: { state: running ? 'starting' : 'not_running' }
});
}On macOS (#12528) process.kill(pid, 0) throws EPERM in the sandbox, so this yields stale_bootstrap. On Windows the sandbox user can observe the PID, so it yields starting. Same root defect, worse symptom — stale_bootstrap at least signals something is wrong, while starting invites indefinite waiting.
Defect 2 is platform-independent and fixable without touching any ACL. Fixing it would also address the classification half of #12528.
Environment
- Windows 11 Home 10.0.26200
- Orca 1.4.178
- codex-cli 0.147.0
- Runtime PID 21872,
runtimeId b5ca6fa7-fa8e-4272-b42c-6ffce58d6235
Sandbox principals present on the machine:
CodexSandboxUsers (group) S-1-5-21-...-1003
CodexSandboxOffline (user) S-1-5-21-...-1004
CodexSandboxOnline (user) S-1-5-21-...-1005
Reproduction
- Windows, Codex Windows sandbox provisioned (
CodexSandboxUsersexists). - Orca running and healthy.
codex exec --sandbox read-only "run: orca status --json"→"starting",reachable: false, indefinitely.- Same command outside the sandbox →
"ready",reachable: true. - Any runtime-dependent command (e.g.
orca orchestration send --type worker_done) fails withruntime_unavailablein step 3, succeeds in step 4.
Note that Orca's own permission UI cannot produce this configuration: tui-agent-permissions.ts offers only manual (no flag) or yolo (--dangerously-bypass-approvals-and-sandbox). Reaching it requires passing --sandbox to Codex directly, which is likely why this has gone unreported despite the symptom appearing in several issues.
Suggested fix — Defect 1
Add an ACE for the Codex sandbox principal to the runtime pipe's DACL.
Grant only the rights a duplex client connection requires — read data, write data, read/write attributes, and SYNCHRONIZE — not GENERIC_ALL or full control. Specifically do not grant:
WRITE_DAC/WRITE_OWNER— the sandbox has no business administering the pipe's ACL or ownership.FILE_CREATE_PIPE_INSTANCE— this one matters: granting it would let the sandbox user create additional instances of the runtime pipe and impersonate the server to other clients. The ask is "connect and talk", not "co-host the endpoint".
This does not weaken authorization. transport.ts already treats transport reachability and RPC authentication as separate concerns — every request carries metadata.authToken, which is readable only by principals already granted the metadata file. Widening the pipe DACL lets the sandbox reach the runtime; it does not grant it RPC authority.
Implementation constraint
The blocker is that net.createServer().listen(pipePath) exposes no security-descriptor surface, and libuv owns the handle with no public JS accessor. A security descriptor supplied at CreateNamedPipe time, via native code, is the direct route.
The existing Windows ACL helper is not reusable here. src/main/win32-utils.ts shells out to icacls.exe, which operates on filesystem objects only and cannot set a DACL on a named pipe. This needs a native path, not an extension of the current helper.
I'd welcome direction on the preferred approach before attempting a PR.
Suggested fix — Defect 2
Preserve the underlying error code on the socket error path instead of discarding it, and classify EPERM/EACCES distinctly from a runtime that is genuinely still starting. A permission-denied connect should surface as a permission problem with actionable guidance, and must not resolve to a state that tells callers to keep waiting.
This is a small, cross-platform, native-free change and could land independently of Defect 1.
A local websocket fallback will not work on Windows
Pre-empting the obvious workaround: the runtime does advertise ws://0.0.0.0:6768, but
- the CLI only ever selects
unix|named-pipe(transport.ts,metadata.ts), andwebsocket-transport.tstargetsremote-runtime-clientwith a remote pairing, not a local endpoint; and - even with a local fallback added, Codex's own firewall rules block the offline sandbox account from loopback TCP:
codex_sandbox_offline_block_loopback_tcp Outbound Block Enabled
codex_sandbox_offline_block_loopback_udp Outbound Block Enabled
codex_sandbox_offline_block_outbound Outbound Block Enabled
Workaround
--sandbox danger-full-access for Orca-managed worker terminals. This runs the worker as the human user, so it hits the owner ACE and bypasses the firewall rules — at the cost of defeating the sandbox entirely.
Related
- CLI reports stale_bootstrap for healthy runtime inside Codex sandbox on macOS #12528 — same class on macOS (
stale_bootstrapviatask_name_for_pidEPERM). This is the Windows counterpart; Defect 2 is common to both. - [Bug]: Orchestration works with omp but stalls when worker is Codex #12253 — Codex-worker orchestration stalls. This could explain the Windows instances of that report; that issue may well also contain unrelated TUI/injection failures.
- [Docs] What happens to
worker_done/asksent while the runtime is unreachable — queued or lost? #12986 — docs question aboutworker_donesent while the runtime is unreachable. This is one concrete way that state arises. - [Bug][Windows] Worktree removal effectively always fails: connect ENOENT on orca-terminal-host pipe #10087 —
[Bug][Windows] connect ENOENT on orca-terminal-host pipe; adjacent Windows pipe-transport issue. - [Bug]: [Security] Agent hooks POST over loopback TCP with URL-encoded payloads — enterprise IDS blocks them, silently losing agent status #11217 — agent hooks over loopback TCP blocked by network policy; precedent for local transports blocked by environment.
Activity
manuaudio commentedon Aug 11, 2026
Both citations check out on
upstream/mainat20848169e0, and Defect 2 splits into two halves with very different costs — one is free and contract-safe, the other is a published-enum change. Worth separating before anyone writes the patch, because "Defect 2 is platform-independent and fixable without touching any ACL" is true of the first half and only half-true of the second.Defect 2a — the errno is discarded at capture (free to fix)
src/cli/runtime/transport.ts:69-77, verbatim:The handler does not even bind the error argument —
() =>, not(err) =>. So the errno isn't merely dropped downstream, it's discarded at the point of capture, and no amount of work further down can recover it. YourEPERM syscall=connect errno=-4048never exists inside Orca's process.This half is cheap and carries no contract risk: keeping the
RuntimeClientErrorcode asruntime_unavailablewhile folding the errno into the message (or a detail field) changes nothing any consumer branches on. That matters, becauseruntime_unavailableis a consumed contract —src/cli/format.ts:80and:98, andsrc/cli/handlers/orchestration.ts:308(getClientErrorCode(err) === 'runtime_unavailable') all dispatch on it, plus three more construction sites intransport.ts(:27,:86,:172) and three inmetadata.ts(:17,:27,:60). Changing the code would ripple; enriching the message would not.Worth noting the same handler shape swallows a second case: the
socket.once('close', …)path at:82-91also hardcodes "Restart Orca and try again." Your observation that the suggested remedy cannot work — a restart recreates the pipe with the same DACL — applies to both.Defect 2b — the classification has no correct value to move to
src/cli/runtime/status.ts:59-73is as you quoted. The trap is one level up, in the enum it must produce —src/shared/runtime-types.ts:99-104:There is no member meaning "running, healthy, and I am not permitted to reach it." So the classification fix is not a free relabel:
unreachable,permission_denied, …) changes the publishedorca status --jsonsurface. Every coordinator or script that switches onruntime.stategets a value it has never seen — and the failure mode of an unhandled state in a wait loop is the same indefinite hang this issue is about, just relocated.stale_bootstrapis semantically wrong (the bootstrap is not stale; the runtime is live and correct) and merely reproduces the macOS CLI reports stale_bootstrap for healthy runtime inside Codex sandbox on macOS #12528 symptom on Windows. You already notestale_bootstrap"at least signals something is wrong" — but as a fix it trades a wrong-and-silent state for a wrong-and-loud one.So 2b needs a maintainer call on the enum, which 2a does not. If they're bundled into one PR, the free half waits on the contract half.
Suggested ordering
code/errno/syscallinto the message. No contract change, and it converts this entire investigation into a one-line log for the next person. It also makes 2b diagnosable in the field before anyone commits to an enum value.CliRuntimeStategains a member.NULLlpSecurityAttributesdefault, and your constraint is real:net.createServer().listen(pipePath)exposes no security-descriptor surface. I'd add one consequence you may want to state explicitly for maintainers — a nativeCreateNamedPipeWroute means the pipe-creation path stops being pure-JS on Windows only, which is a build/packaging change (a native module in the runtime's startup path), not just a code change. That cost belongs next to the ACE design in the decision.One check I'd add to the ACE proposal
Your rights list is well-argued, and the
FILE_CREATE_PIPE_INSTANCEexclusion is the right instinct — without it a sandbox principal could stand up a rival instance of the same pipe name and serve other clients. Worth pairing it with the observation that the pipe name is derived from the PID (\\.\pipe\orca-21872-b5cain your capture), so the name is guessable from information the sandbox already has; the ACE is the only thing standing between "can reach" and "can impersonate". That strengthens the case for the narrow right set rather thanGENERIC_ALL.Happy to send the 2a patch if that's useful — it's self-contained and doesn't presuppose the outcome of either other decision.
pdminh97 commentedon Aug 21, 2026
I reproduced an adjacent failure on a newer build where the strict Codex sandbox is blocked even before the named-pipe connection described here.
Environment:
1.4.1850.149.0read-only, approvalsnever, internal agents disabledFrom the host,
orca status --jsonreported the app/runtime/graph ready and reachable. In a fresh Orca-managed Codex terminal, however:orcawas not onPATH;%LOCALAPPDATA%\Programs\orca\resources\bin\orca.execould not be resolved/executed and PowerShell returnedCommandNotFoundException;AccessDeniedfromTest-Path.The host CLI remained ready throughout. I made the executable check a fail-closed preflight, so no Run/Task/Dispatch was created and no lifecycle completion was manufactured in this retry.
This appears complementary to the pipe DACL problem in the issue: even after the named-pipe rights are fixed, an Orca-managed strict Codex worker first needs read/execute access to the runtime-matched CLI (or a sandbox-visible launcher). It would also help if Orca reported these separately:
PATH;The current workaround (
danger-full-access) avoids both barriers but removes the reviewer sandbox, so it is not suitable for a strict read-only review workflow.Tauri-EPO commentedon Aug 22, 2026
Reproduced on v1.4.188 (newer than the 1.4.185 in the comment above), and I have a concrete instance of the impact this report already states — including what it cost.
What happened
I was running a four-lane orchestration where each lane's work was reviewed by a dispatched Codex worker. One of those reviewers completed its entire task — a full adversarial review of an uncommitted diff, 10m56s of work, 39 targeted tests plus
typecheck,oxlintand themax-linesratchet — and then could not deliver a single byte of it.Its two
worker_doneattempts, verbatim from the terminal:It retried once after a 15s sleep, got the same answer, and stopped — correctly, since the guidance tells a worker not to escalate around a channel it cannot reach.
From my coordinator terminal, at the same time, on the same machine:
So this is the split this issue describes: one live runtime, two identities, two different answers.
The cost, concretely
The review's findings were never in the database. The Dispatch stayed
ready/input_acceptedwith no heartbeat at all, which from the coordinator's side is indistinguishable from a worker still thinking. I only recovered the findings — one HIGH and one MEDIUM, both real and both acted on — by reading them off the terminal screen withorca terminal read --limit 120and transcribing them by hand.That is the part I would add to the impact section: it is not only that
worker_donefails. It is that the work product still exists, on screen, in a pane a human can read, while every machine-readable surface says the lane never reported. A coordinator that trusts the orchestration state discards finished work.The same session also showed
spawn EPERMinside the sandbox on the worker's firstvitestand first ratchet run; both passed when retried outside it. Consistent with the separate-local-user mechanism described in the report.One observation I could not finish testing, offered as a lead rather than a claim
I ran four Codex reviewers in this session. Three delivered
worker_donenormally; one did not — the one above.The three that worked were created by Orca itself (
worker-start --agent codex, which creates the terminal and launches the agent). The one that failed was a terminal where Orca's launch had left a bare shell, so I started the agent by hand withorca terminal send --terminal <h> --text "codex" --enter.That is three data points and a plausible story — that Orca's own launch path sets something in the child environment the sandbox needs, and a hand-started
codexin an Orca terminal does not inherit it. It is not proof: I had a fourth terminal in the same hand-started state and could not complete the experiment on it before the run ended, so the correlation stands at 3/3 with no counter-example and no confirmation.If it holds, it would narrow this from "the sandbox cannot reach the pipe" to "the sandbox cannot reach the pipe unless Orca's launch path grants it something", which is a much smaller thing to find. Worth a
whoamicomparison between an Orca-launched and a hand-started Codex in the same worktree — if they report different sandbox accounts, that is the whole answer.Environment
Windows 11 Pro 26200, Orca v1.4.188 (runtime
ready, reachable from the host), Codex CLI 0.148.0,gpt-5.6-solat medium effort, agent terminals in Orca-managed worktrees.jimmylee-cell commentedon Aug 26, 2026
Additional implementation finding from a live Surface reproduction (exact pipe connect: EPERM/-4048): a server-side DACL helper alone cannot satisfy the issue's stated least-privilege constraint while the CLI remains on Node/libuv.
libuv open_named_pipe() opens duplex clients with CreateFileW(..., GENERIC_READ | GENERIC_WRITE, ...). Windows maps GENERIC_WRITE to FILE_GENERIC_WRITE, which includes FILE_APPEND_DATA; for named pipes that bit is the same value as FILE_CREATE_PIPE_INSTANCE. Therefore an ACE sufficient for the current Node client also grants the sandbox principal the ability to create another server instance, contrary to the issue's explicit exclusion.
Microsoft documents both facts: named-pipe DACLs can be changed with SetSecurityInfo, and FILE_GENERIC_WRITE includes the create-instance-equivalent bit. A post-listen SetSecurityInfo helper is technically possible, but not least privilege with the current client open mask.
Safe implementation options appear to be:
I opened #16622 for the independent diagnostics defect (preserve EPERM/EACCES and stop reporting permanent starting). I am intentionally not proposing writableAll, GENERIC_WRITE, or a broad CodexSandboxUsers DACL as the native fix.
FreezeME2 commentedon Sep 1, 2026
We hit this on 1.4.191 (the issue reports 1.4.178). The symptom matches exactly: inside a Codex terminal
tsendfails withCould not connect to the running Orca app. Restart Orca and try again.(rc=3), while at the same momentorca statusfrom a Claude terminal reportsready/reachable: true. The Codex terminal reportsstarting/reachable: false/runtimeId: null, withCreateFile: Access is denied. (0x5)printed on screen.One detail differs from the issue description, and it may help narrow the cause.
The issue attributes the failure to a separate sandbox account (
CodexSandboxOffline/CodexSandboxOnline). In our casewhoamiinside the Codex terminal returns the ordinary user account, not a sandbox account. Config is[windows] sandbox = "unelevated".Boundary measurements taken from inside that Codex terminal:
Access to the path '<user home>\_sbtest_out.txt' is denied)So it looks like a restricted token rather than a different principal. Anyone reading this issue should not conclude that switching the account is enough.
Workaround we use: launch Codex with
-s danger-full-access. That restorestsend(verified: rc=0 and the notice actually arrived at the receiving terminal). The cost is that the sandbox is off entirely, so we only do it for terminals that must report back.Secondary observation — the transport collapses the underlying error into
runtime_unavailable, and the status check appears to look only at process liveness, so a healthy runtime is reported asstarting. Surfacing the original errno would have saved us a day of misdiagnosis: we first blamed our own launch script for omitting a handle, because the symptom looked identical.haden111 commentedon Sep 4, 2026
Windows Codex sandbox cannot communicate with Orca runtime
We encountered what appears to be the same operational failure on a Windows 11 Codex/Orca setup.
During supervised development, a Codex worker could be doing useful work while Orca/runtime communication from the worker side was unavailable or reported incorrectly. In practice this meant lifecycle reporting such as
worker_donecould not reliably reach the coordinator even though the Orca runtime itself was alive from the coordinator's point of view.The particularly damaging part is the state classification. If an IPC permission/connectivity problem is reported as the runtime merely
starting, an unattended coordinator has no reason to stop waiting. That turns a permission/transport defect into an indefinite orchestration stall.We eventually stopped relying on the Windows Orca/Codex path partly because this made successful worker execution and successful lifecycle reporting two different things.
I cannot claim that we independently proved the named-pipe DACL root cause described in this issue, but our observed behaviour and impact match it closely:
A distinct permission_denied / IPC-access state instead of permanent starting, plus a supported way for sandboxed Codex workers to reach the local runtime without disabling their sandbox, would remove a major blocker for Windows unattended workflows.
rarusflats commentedon Sep 11, 2026
Third variant of the same
EPERM, from WSL — same impact, plus two observations that may help a fix.Environment: Orca 1.4.199, Codex CLI 0.154.0, Ubuntu-24.04 under WSL2, Codex launched by Orca in the worktree terminal.
Mechanism. Inside the Codex sandbox (identical in
read-onlyandworkspace-write) the shell runs in its own network namespace (readlink /proc/self/ns/net→net:[4026533040]inside vsnet:[4026531840]on the host) with seccomp filters active. The WSL launcherorca→powershell.exe→orca.exeneeds the WSL interop, which fails with:(errno 1 = EPERM). The same command succeeds outside the sandbox. Any Windows executable fails the same way (
/mnt/c/Windows/System32/cmd.exe /c "echo ok"), and every host loopback port is unreachable from inside (curl 127.0.0.1:<hook-relay-port>→Couldn't connectin 0 ms, while it answers 403 from the host).Reproduction of the impact.
orca orchestration run-create,task-create --spec <trivial read-only task>,worker-start --task <id> --worktree current --agent codex→state: ready,stage: input_accepted,turnStart: observed. The worker got the preamble + TASK and did the work.orca orchestration send … --type worker_done …exactly once → the error above. (heartbeat,askandescalationgo through the same CLI, so none can be delivered either.)worker-showevery 20 s for 9 minutes after the agent went idle:status: dispatched,lastHeartbeatAt: null,completedAt: null;worker-readreportsstatus: {worker: ready, terminal: running, liveness: live}.Observation 1 — the runtime already has the signal it would need.
worker-read --dispatch <id>returnssource: transcript,sourceExact: truewith the full hook-reported transcript (12 messages, including the agent's final text and the failedworker_donetool call). So the host-side hook deliversStop+ transcript while the Dispatch state never moves. Settling (or at least flagging) a supervised Dispatch when the hook reports the worker idle after a failedworker_donewould close the indefinite wait without touching any sandbox/ACL.Observation 2 — recovery leaves a misleading record and a live terminal.
task-update --status completedis refused while the Dispatch is active (task_not_startable … stop or settle its worker first).worker-abandonsettles it asfailedfor work that succeeded; afterwardstask-update completedis accepted, butworker-releasereturnsstate: retained, reason: identity_unprovenand the worker terminal stays open until a manualterminal close.Happy to provide the full JSON outputs (tokens redacted) if useful.
etomarat commentedon Sep 17, 2026
I am seeing the same user-visible symptom on Windows 11, build 26200.9457, with Orca 1.4.205.
The Orca desktop UI and its embedded browser are working. I can manually use the browser tab at
http://127.0.0.1:5173/; the local site returns HTTP 200.However, the Orca CLI cannot connect to the local runtime. This persists after fully closing all
Orca.exeprocesses and restarting Orca.orca status --jsonreturns:{ "id": "local-status", "ok": true, "result": { "target": { "kind": "local" }, "app": { "running": true }, "runtime": { "state": "starting", "reachable": false, "connectionState": "disconnected", "runtimeId": null }, "graph": { "state": "starting" } }, "_meta": { "runtimeId": "none" } }orca tab list --jsonreturns:{ "id": "local", "ok": false, "error": { "code": "runtime_unavailable", "message": "Could not connect to the running Orca app. Restart Orca and try again." } }The CLI also prints this warning on invocation:
Could this be the same named-pipe transport/ACL problem being mapped to
runtime.state = "starting"? If not, what additional safe diagnostics would help distinguish the cause?