Skip to content

Support codex-app Linux layouts and version-safe backups#18

Draft
siraht wants to merge 2 commits into
b-nnett:mainfrom
siraht:linux-am-will-codex-app-compat
Draft

Support codex-app Linux layouts and version-safe backups#18
siraht wants to merge 2 commits into
b-nnett:mainfrom
siraht:linux-am-will-codex-app-compat

Conversation

@siraht

@siraht siraht commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Add installer compatibility for the community Linux packages from
am-will/codex-app, including the current ChatGPT-branded Codex payload, and keep the
Codex++ rollback backup aligned with the app build being patched.

Changes

  • Detect common codex-desktop Linux install roots under /usr/lib, /opt,
    ~/.local/opt, and ~/.local/share.
  • Resolve launcher/current-version symlinks before determining the app root.
  • Accept the Linux Electron executable names Codex, codex-desktop, and codex.
  • Search for main-*.js beside a nested recovered entrypoint as well as the standard
    .vite/build directory.
  • Match the current window-services factory when appBrand appears before
    buildFlavor in its options object.
  • Rotate the backup set when the app root or in-place app build changes.
  • Preserve a matching pristine backup on repeated installs of the same patched app.
  • Reject an already-patched app when its saved state and pristine backup do not agree,
    instead of creating an unsafe rollback point.
  • Abort before rotating backups when target app metadata cannot be read.

Why

The Linux port uses layouts such as:

/usr/lib/codex-desktop/Codex
/usr/lib/codex-desktop/resources/app.asar
~/.local/opt/codex-desktop/current -> <versioned install>

Those layouts were not covered by the existing Linux locator. The current 26.707
ChatGPT/Codex payload also constructs window services with appBrand before
buildFlavor, which caused installation to fail with:

Codex window services hook point not found

Separately, Codex++ uses one backup directory. Keeping the first-ever app.asar
indefinitely means that installing against a newer app can leave uninstall prepared
to restore an unrelated old build. The new backup preparation step validates repeated
installs and retires the old set before backing up a fresh app build.

Validation

npm test
npm run build
git diff --check

The test suite covers:

  • directory and symlink Linux overrides
  • nested recovered main-bundle discovery
  • appBrand before buildFlavor
  • new install-root backup rotation
  • in-place app update backup rotation
  • repeated-install backup preservation
  • stale backup rejection
  • invalid target metadata preservation

Live validation against a user-owned am-will/codex-app 26.707.31123 package completed
installation, patched .vite/build/early-bootstrap.js, flipped the Electron integrity
fuse, and passed codexplusplus status and codexplusplus doctor.

@siraht siraht changed the title Support codex-app Linux install layout Support codex-app Linux layouts and version-safe backups Jul 9, 2026
@siraht siraht marked this pull request as draft July 9, 2026 22:40
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