codex icon indicating copy to clipboard operation
codex copied to clipboard

Locked Use fails with two macOS accounts logged in: shared authorization socket ownership conflict

Open farbodg opened this issue 3 weeks ago • 2 comments

What version of the Codex App are you using (From “About Codex” dialog)?

26.1103.41825 (25679). Computer Use helper and installed authorization plug-in: 26.1102.1001824 (1001824).

What subscription do you have?

Pro 200

What platform is your computer?

macOS 15.8.1 (24H32), Apple Silicon. Two macOS user accounts using Fast User Switching; a Codex/Computer Use helper runs in each account.

What issue are you seeing?

Locked Use works with only one macOS account logged in, but fails reproducibly when a second account is logged in and running its own Computer Use helper. The second helper reports SocketError Code=7 (socketDirectoryWrongOwner) against a shared machine-wide authorization socket directory.

This is a focused follow-up to #58452, which I closed with the repair/workaround findings. It may explain a subset of reports like #57709; I am not claiming all automatic-unlock failures have this cause.

The visible error is: “Mac is locked and automatic unlock could not unlock it.” Keeping the first account logged in but switching to the second also produced a case where a Finder accessibility tree and screenshot were readable, while actual window control failed with Computer Use server error -10005: cgWindowNotFound.

What steps can reproduce the bug?

Use two macOS accounts, A and B, with Locked Use enabled.

  1. Start with only account A logged in and the desktop app running. Lock the Mac and request a native Computer Use task from a connected device, such as opening a Finder window.
  2. Confirm the task succeeds and the authorization plug-in logs ALLOW.
  3. Log into account B through Fast User Switching, leaving A logged in, and start the desktop app/Computer Use helper in B.
  4. Lock B and request Computer Use from a connected device targeting B. On my machine, B's helper has already logged the socket ownership error, automatic unlock fails, and the authorization plug-in logs DENY.
  5. Log B out, return to A, and lock it. Repeat the Finder task targeting A. Automatic unlock and opening a new Finder window succeed again without restarting.

The helper startup failure was also observed with the account roles reversed: whichever account did not own the shared directory reported Code 7.

What is the expected behavior?

Having a second macOS account logged in should not silently break Locked Use in another account or make functionality depend on which account owns a shared temporary directory.

Ideally, Computer Use/Locked Use should isolate and route authorization correctly for each macOS user session. If concurrent macOS sessions are unsupported, please document that limitation and surface an actionable error instead of the generic automatic-unlock failure.

Additional information

Evidence from local diagnostics

Both helpers use:

/tmp/com.openai.sky.CUAService/LockScreenLoginAuthorization.sock

The parent directory was mode 0755 and owned by one account. The other account's helper emitted:

log[2f5fac05e5d0ba21df22]
Error Domain=ComputerUse.(unknown context ...).SocketError Code=7

Read-only inspection of the installed helper's symbols/disassembly showed that LockScreenLoginAuthorizationSocketServer.start checks whether the existing directory's owner matches geteuid(); the owner-mismatch branch produces error discriminator 7, corresponding to socketDirectoryWrongOwner.

Observed: the non-owning helper fails the directory ownership check; automatic unlock fails in the two-account setup; reversing startup/account order reverses which account hits the error.

Hypothesis requiring maintainer confirmation: the shared endpoint prevents independent per-user authorization handling, potentially routing a request to a helper without the matching pending unlock attempt. The exact causal path from this startup error to each DENY is not proven.

Controlled tests on November 8, 2026 (EST)

State Result
Only A logged in after restart; directory owned by A Automatic unlock succeeded; plug-in logged ALLOW at 22:23:00
B logged in afterward; both helpers running; directory still owned by A B's helper logged Code 7; unlock attempts logged DENY
A in the background while B was active and locked Finder tree/screenshot retrieval succeeded, but an attempt to open a window failed with -10005: cgWindowNotFound
B logged out again; only A logged in and locked Plug-in logged ALLOW at 22:27:51; a new Finder window opened successfully, without another restart

The background-session window-control failure is an additional observation, not proof that it has exactly the same cause as the socket ownership failure.

Stale plug-in was repaired before these tests

Initially, the installed authorization plug-in was build 1001631 while the bundled plug-in/helper were build 1001824. Turning Locked Use off/on and approving the administrator prompt updated the installed plug-in to 1001824. The installed executable then matched the bundled copy, signatures verified, and the screensaver authorization rule referenced the expected remote authorization mechanism. The two-account failure persisted afterward, so matching plug-in versions alone did not resolve it.

Workaround and regression history

Logging the other macOS account out restored native Computer Use on this machine. Merely switching accounts did not. An initial reboot with only the target account logged in helped isolate the issue; the later successful logout-only test showed that another reboot was not necessary.

I previously used this while the other macOS account was active. It began failing consistently a few updates ago, but I do not have an exact last-known-good version.

No socket permissions, ownership, or authorization rules were manually changed during this investigation. The newer “Show user name and photo” Lock Screen setting was absent on this macOS version and was not part of the workaround.

farbodg avatar Nov 09 '26 03:11 farbodg

I can report a similar failure on a Mac with two simultaneously logged-in macOS users.

Environment

  • macOS 15.6
  • ChatGPT/Codex desktop 26.1103.31037 (build 25241)
  • Computer Use helper / authorization plug-in build 1001824
  • Administrator user UID 501 and target remote user UID 502, both logged in via Fast User Switching

Observed behavior

  • Native Computer Use works in the target user's Chrome when the desktop is manually unlocked.
  • Locked Use is enabled; the authorization plug-in was found installed, signed, and registered.
  • Locked Use fails with The Mac is locked and automatic unlock could not unlock it.
  • /tmp/com.openai.sky.CUAService (mode 0755) and LockScreenLoginAuthorization.sock are owned by UID 501, while the requesting SkyComputerUseService runs under UID 502.

Logs from November 9, 2026, 21:37:29 CET (UTC+1)

  • SkyComputerUseService performed signature/trust checks.
  • CUALockScreenGuardian was active.
  • At 21:37:30.025, SkyComputerUseService logged E ... [inc.software.app:Computer Use] log[34f610ab61c02cb35735].
  • loginwindow showed the target user's locked-session authentication UI. No successful unlock.
  • The relevant log excerpt does not contain an explicit SocketError Code=7 or socketDirectoryWrongOwner, so the ownership mismatch remains a strong hypothesis rather than a confirmed cause.

Separately, the integrated browser reported listen EACCES under /tmp/codex-browser-use, also owned by UID 501. This is a distinct issue.

Could maintainers clarify what log[34f610ab61c02cb35735] means in build 1001824, whether it relates to the shared authorization-socket ownership check, and whether per-user/session endpoint isolation or a supported workaround is available? I want to preserve both logged-in sessions without weakening macOS protections or changing socket permissions manually.

jacopolunardi13 avatar Nov 10 '26 01:11 jacopolunardi13

Additional reproduction on macOS 27.0.1: password field is found, but the shared authorization socket returns DENY

I can reproduce a closely matching failure with two macOS accounts logged in. This adds a controlled password-prompt visibility test and a recorded authorization denial.

Environment:

  • macOS 27.0.1 (26A434), Apple silicon.
  • ChatGPT/Codex desktop 26.1103.41825 (build 25679).
  • Computer Use helper and installed authorization plug-in 26.1102.1001824 (build 1001824).
  • Both accounts run ChatGPT/Codex. Account A is on the physical console; account B is accessed through Apple Screen Sharing in a separate, off-console session.
  • Locked Use is enabled.

Component checks: The installed authorization plug-in was initially build 1001631. It was refreshed using the official bundled installer. The installed and bundled plug-in executables now have matching SHA-256 hashes, and strict signature verification passes. The authorization mechanism remains registered. Refreshing the component did not resolve the failure below.

Observed sequence, tested November 11:

  1. Manually unlock account B and keep Screen Sharing connected.
  2. Successfully read Calculator through supported Computer Use. This establishes a working unlocked baseline after restarting the desktop app.
  3. Lock B. If the session shows a blank background, click to reveal the normal password prompt. Leave the password empty and keep Screen Sharing connected.
  4. Independently confirm B is still locked and off console.
  5. Request Calculator again. The tool returns: "The Mac is locked and automatic unlock could not unlock it."

The logs distinguish two stages:

  • Immediately after locking, the helper's control search initially reports one node and no matching password field.
  • With the prompt visible, a subsequent attempt reports 11 nodes and a matching field, invokes CodexComputerUseAuthorizationPlugin:allow, and receives DENY from the authorization socket. Standard authentication fallback then ends with "Evaluate denied."

Normalized diagnostic excerpts (timestamps and process identifiers removed):

log[2f5fac05e5d0ba21df22] ... SocketError Code=7
log[d76fdc6f08ef96a8250f] [0]=11 [1]=true
Login authorization socket response=DENY
allowed=NO
Evaluate denied

Shared endpoint observations:

  • The plug-in references /tmp/com.openai.sky.CUAService/LockScreenLoginAuthorization.sock.
  • Its parent directory is owned by account A, mode 0755.
  • The socket is also owned by A, mode 0666.
  • B's helper logs SocketError Code=7 at startup. Its open-socket listing shows its own per-user control socket, but not this shared authorization socket.

Separately, disconnecting Screen Sharing after manually unlocking B causes ScreensharingAgent to request an immediate lock. Leaving B unlocked before disconnecting therefore did not preserve unattended app access in our test.

Interpretation and limits: This supports the shared-endpoint ownership conflict described here. The visible-prompt test also shows that our failure can proceed beyond password-field discovery. I have not independently mapped the active authorization-socket listener PID or proved the precise routing that produces DENY. The Code 7 enum mapping comes from the analysis in this issue; I have not independently disassembled that branch.

A platform-binary library-validation warning appeared during the same attempt, but the plug-in subsequently ran and logged the socket's DENY response. I am not treating that warning alone as the cause.

I have not performed a single-account logout comparison or reversed the account startup order on this machine. Both users need their ongoing jobs and desktop automation to remain running, so logging either account out is not a practical ongoing workaround.

Could maintainers confirm whether concurrent macOS sessions are supported, provide a recovery path that preserves both sessions, and investigate per-user/session authorization routing? Distinct errors for control-discovery failure, socket ownership failure, and authorization denial would make diagnosis much clearer.

No socket ownership/permission changes, manual authorization-rule edits, or binary patches were used. This report contains no usernames, hostnames, network addresses, account/session identifiers, screenshots, message contents, credentials, or raw log bundles.

thewanderer1 avatar Nov 18 '26 21:11 thewanderer1