Repository navigation
[Bug] Windows PowerShell -WindowStyle Hidden causes EACLIDENTITY under Bun #1589
Description
Client or integration
OpenCodex dashboard / Codex configuration sync
Area
Windows compatibility / identity lookup / configuration writes
Summary
This report supersedes #1588, which was automatically closed before the required version and operating-system fields were present.
On Windows 11 x64, OpenCodex cannot resolve the effective Windows account when it launches PowerShell through Bun with the CLI arguments -WindowStyle Hidden.
This causes configuration writes and model synchronization to fail with:
CodexUserIdentityRefusal: Windows effective-account lookup failed.
The same behavior was observed in OpenCodex 2.12.0 and remains reproducible in 2.14.0, so this appears to be a cross-version compatibility issue rather than a regression introduced only by 2.14.0.
Version
- OpenCodex: 2.14.0
- Bundled Bun: 1.3.14
Operating system
- Windows 11 Pro 23H2
- OS build: 22631
- Architecture: x64
Reproduction
Windows PowerShell executable:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
The following Bun invocation fails with exit code 255 and empty stdout/stderr:
Bun.spawnSync(
[
powershell,
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-WindowStyle",
"Hidden",
"-Command",
"[System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value",
],
{
stdin: "ignore",
stdout: "pipe",
stderr: "pipe",
timeout: 8000,
windowsHide: true,
},
);The same invocation succeeds and returns the account SID when the PowerShell CLI pair "-WindowStyle", "Hidden" is removed.
Directly running the PowerShell command also succeeds. Start-Process -WindowStyle Hidden from inside PowerShell works as well; the failure appears specific to passing -WindowStyle Hidden as a PowerShell CLI argument to a Bun-spawned process.
Actual impact
The failure affects code paths that need effective-account identity, including:
- configuration writes and synchronization
- ACL hardening
- Codex coordinator/configuration path resolution
The user-facing result is an identity/configuration error even though the Windows account and filesystem are otherwise usable.
Suggested fix
For direct PowerShell child-process argument arrays, remove the CLI arguments:
"-WindowStyle",
"Hidden",and retain Bun's:
windowsHide: trueThis preserves hidden process creation without passing the failing PowerShell CLI option. The Start-Process -WindowStyle Hidden usages inside PowerShell scripts should be evaluated separately because they work in the affected environment.
Relevant call sites include src/codex/user-identity.ts, src/lib/windows-user-principal.ts, src/config.ts, src/codex/app-server-processes.ts, src/tray/windows.ts, and src/update/job.ts.
Expected behaviour
Effective-account lookup should succeed on Windows when PowerShell is launched through Bun, or the error should identify the incompatible process argument explicitly rather than surfacing as a generic EACLIDENTITY / identity refusal.
No credentials or personal account identifiers are included in this report.
Activity
coderabbitai commentedon Aug 13, 2026
-WindowStyle Hiddencauses EACLIDENTITY when spawned by Bun on Windows #1588🔗 Related PRs
#644 - fix(windows): follow active Codex home for tray listener [open]
#801 - test(windows): retry one transient CIM enumeration timeout [merged]
#887 - fix(windows): settle scheduler verification and record Bun runtime provenance [open]
#1279 - fix(windows): eliminate console windows from proxy-internal identity & process lookups [open]
#1347 - fix(windows): stop console popups from proxy-internal PowerShell lookups (
#1278) [merged]📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
Ingwannu commentedon Aug 14, 2026
Confirmed on current
devand fixed in PR #1674. The direct PowerShell children redundantly passed-WindowStyle Hiddeneven though their Bun/Node launchers already usedwindowsHide: true(or a hidden VBS host). The PR removes only that incompatible direct CLI pair across identity, ACL principal, process inspection, config PID validation, tray, and update paths. InnerStart-Process -WindowStyle Hiddenand .NET/VBS hidden-window controls remain unchanged.Local focused verification is green (280 passed, 1 Windows-only integration test skipped on Linux, 0 failed), plus typecheck and privacy scan. Keeping this issue open until exact-head Windows CI and an affected-Windows smoke test confirm the fix.
lidge-jun commentedon Aug 14, 2026
Fixed by cherry-picking #1674 (fix(windows): avoid PowerShell WindowStyle argv under Bun) onto dev at be191b0d4.
fix(windows): stop the service wrapper killer using the argv Bun rejects
fix(windows): one scheduler-wrapper killer, scoped to one installation
devlog: open the Windows stability program unit
fix(windows): stop the service wrapper killer using the argv Bun rejects
fix(windows): one scheduler-wrapper killer, scoped to one installation
devlog: open the Windows stability program unit