You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Windows] ocx service install refuses: effective-account SID lookup times out on cold PowerShell start #7544
On the main push Service lifecycle workflow (run 39812199456, attempt 1, job windows-schtasks), ocx service install failed with CodexUserIdentityRefusal: Windows effective-account lookup timed out. before it reached Task Scheduler. The attempt 2 rerun of the same commit passed.
The SID for the Windows service mutation lock path is resolved by spawning powershell.exe to evaluate [System.Security.Principal.WindowsIdentity]::GetCurrent().User.Value. That child already has a 30s budget (widened in #2914), and the step still spent ~35s and hit it. A cold PowerShell start on a loaded runner is the whole cost: the value itself is a constant of the process token.
Expected: resolving the current process SID should not depend on PowerShell startup time on Windows x64, where the same module already reads LocalAppData in-process through bun:ffi (src/codex/windows-local-appdata.ts). A lookup that genuinely fails must still refuse (fail closed).
Reproduction
Intermittent; observed on a GitHub-hosted windows-latest runner.
GitHub Actions windows-latest (Windows Server, x64), Bun 1.4.2
Provider and model
No response
Logs or error output
CodexUserIdentityRefusal: Windows effective-account lookup timed out.
code: "CODEX_USER_IDENTITY_REFUSED"
at refuse (src\codex\user-identity.ts:101:9)
at powershellValue (src\codex\user-identity.ts:254:34)
at resolveWindowsSid (src\codex\user-identity.ts:263:15)
at resolveEffectiveUserIdentity (src\codex\user-identity.ts:281:38)
at windowsServiceMutationLockPath (src\lib\windows-service-mutation-lock.ts:57:20)
at withWindowsServiceMutationLock (src\lib\windows-service-mutation-lock.ts:82:37)
at serviceCommand (src\service\cli.ts:526:11)
Bun v1.4.2 (Windows x64)
Screenshots and supporting files
No response
Redacted configuration
{"port":10199,"providers":{}}
Checks
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
Fixed on dev by #7548 (merged just now): on Windows x64 the service-install SID lookup now reads the token SID in-process through advapi32 instead of starting PowerShell, so ocx service install no longer hits the 30 s lookup budget (Service lifecycle windows-schtasks: 35 s failing → 11 s passing on the exact head). Closing manually because GitHub only auto-closes from main. The remaining PowerShell use for the ACL principal is tracked in #7547.
Activity
fix(windows): read the effective SID in-process so service install do…
lidge-jun commentedon Oct 22, 2026
Fixed on
devby #7548 (merged just now): on Windows x64 the service-install SID lookup now reads the token SID in-process through advapi32 instead of starting PowerShell, soocx service installno longer hits the 30 s lookup budget (Service lifecycle windows-schtasks: 35 s failing → 11 s passing on the exact head). Closing manually because GitHub only auto-closes frommain. The remaining PowerShell use for the ACL principal is tracked in #7547.