Skip to content

[Bug]: Persisted Codex shim device IDs cause false ownership refusal after an APFS restart #7041

Closed

Description

@flokosti96

Client or integration

Codex CLI

Area

Platform (Windows / macOS / Linux)

Summary

The private Codex PATH shim persists st_dev + st_ino as its ownership identity (src/codex/shim-overlay.ts:45). On APFS the device number of the volume changes across reboots while the inode stays the same. After a restart ocx treats its own unchanged wrapper as foreign ("Private Codex launcher was replaced; preserving it"), reports the shim unhealthy and refuses to repair it.

Reproduction

  1. Install the Codex PATH overlay on macOS/APFS (ocx codex-shim install).
  2. Reboot.
  3. Compare ~/.opencodex/codex-shim.json with stat(), then run ocx update or ocx codex-shim install.

Observed identities (same files, untouched):

wrapper saved (dev 16777233, ino 154244100)  current (dev 16777232, ino 154244100)
env     saved (dev 16777233, ino 154244101)  current (dev 16777232, ino 154244101)

Wrapper owner, content and recorded launcher still match.

Version

@bitkyc08/opencodex 2.84.0

Operating system

macOS 27 (Apple Silicon, APFS)

Provider and model

n/a

Logs or error output

Private Codex launcher was replaced; preserving it
Codex shim installation was refused
opencodex: Codex shim repair failed (1)

Redacted configuration

Client mode, Codex shim installed via ocx codex-shim install.

Proposed fix

Separate durable ownership from same-inspection identity: for the persisted check use a reboot-stable volume identifier (or inode plus the existing path/owner/content validation) instead of st_dev. Keep dev in sameId() for snapshot/transaction checks, which guard against concurrent replacement. Our local workaround compares only the inode for the persisted check.

Screenshots and supporting files

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    platform
    on Oct 13, 2026
  2. lidge-jun commented on Oct 15, 2026

    @lidge-jun
    Owner

    Fixed on dev by #7061 (merged 2026-10-13); dev isn't the default branch, so it didn't auto-close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatform

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions