Skip to content

[codex] Fix Codex 26.527 installer patching#392

Open
flatmoonsociety wants to merge 1 commit into
b-nnett:mainfrom
flatmoonsociety:codex/fix-codex-framework-asar-repack
Open

[codex] Fix Codex 26.527 installer patching#392
flatmoonsociety wants to merge 1 commit into
b-nnett:mainfrom
flatmoonsociety:codex/fix-codex-framework-asar-repack

Conversation

@flatmoonsociety

@flatmoonsociety flatmoonsociety commented May 29, 2026

Copy link
Copy Markdown

Summary

Fixes Codex++ repair/install failures on current Codex Desktop builds that changed the macOS framework layout and contain a large unpacked asar file set. Also updates watcher-mode repair so it applies the disk patch before prompting for a restart.

Root Cause

Codex 26.527 uses Codex Framework.framework with a versioned Versions/Current layout instead of the old Electron Framework.framework/Versions/A/Electron Framework path. The installer still hardcoded the old framework path, so fuse/status/repair operations could fail with ENOENT.

After resolving the framework path, current Codex asars can also exceed the glob pattern length used to preserve unpacked files. The prior repack logic generated one giant brace glob for every unpacked path, which can fail with pattern is too long.

Watcher-mode repair had a separate usability issue: when Codex was running, it could block on the pre-patch quit prompt and leave the bundle unpatched until the user responded.

Changes

  • Resolve the macOS framework binary dynamically, supporting both the legacy Electron framework and renamed Codex framework layouts.
  • Repack asars with explicit stream metadata for unpacked files instead of a giant minimatch glob.
  • Clear the asar cache after replacing app.asar so same-process verification reads the rewritten archive.
  • Let watcher-mode repair apply the patch on disk before asking the user to restart Codex. Interactive repair keeps the existing pre-patch quit prompt behavior.
  • Add regression coverage for large unpacked asar sets and watcher-mode prompt behavior.

Validation

  • npm ci --workspaces --include-workspace-root --ignore-scripts
  • node --import tsx --test packages/installer/test/asar-cleanup.test.ts packages/installer/test/platform.test.ts
  • node --import tsx --test packages/installer/test/tweak-commands.test.ts packages/installer/test/asar-cleanup.test.ts packages/installer/test/platform.test.ts
  • npm run build
  • npm test (121 tests passing)
  • npm run audit (0 vulnerabilities)

@flatmoonsociety flatmoonsociety force-pushed the codex/fix-codex-framework-asar-repack branch from 4d6e220 to 4cce088 Compare May 29, 2026 18:37
@flatmoonsociety flatmoonsociety force-pushed the codex/fix-codex-framework-asar-repack branch from 4cce088 to a654226 Compare May 29, 2026 18:38
@flatmoonsociety flatmoonsociety marked this pull request as ready for review May 29, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant