Skip to content

[0.144] Backport installer and code-mode reliability fixes - #31913

Closed
bolinfest wants to merge 3 commits into
mainfrom
release/0.144
Closed

[0.144] Backport installer and code-mode reliability fixes#31913
bolinfest wants to merge 3 commits into
mainfrom
release/0.144

Conversation

@bolinfest

@bolinfest bolinfest commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Why

The release/0.144 branch needs three reliability fixes before the next patch release:

  • The standalone installer can receive compact GitHub release metadata, but its line-oriented parser can fail to find assets in that format.
  • macOS package installs include codex-code-mode-host, but the installer did not expose it beside codex.
  • Some Codex distributions do not yet include the companion host binary, so code mode must remain available when that executable is absent.

This draft PR targets main only to run CI for the release branch. These fixes already exist on main; the intended deliverable is release/0.144, and this PR should not be merged back into main.

What changed

Validation

GitHub Actions on this draft PR is the source of validation for the release branch. The backported regression coverage exercises compact and reordered release metadata, the macOS code-mode host symlink, and successful code-mode execution when the external host is missing.

efrazer-oai and others added 3 commits July 9, 2026 14:48
# Summary

GitHub's latest-release endpoint can return compact, single-line JSON.
The standalone installer treated release metadata as line-oriented text,
so those responses could make asset lookup fail even though the
requested assets were present.

The regression was introduced by
[#31056](#31056). That change reused
the `/releases/latest` metadata response for both version resolution and
asset lookup, exposing the existing formatting-sensitive asset parser to
compact responses from that endpoint.

This change parses the release metadata once with a one-pass POSIX awk
scanner. The scanner tracks JSON strings and nesting, extracts the root
release tag plus direct asset name/digest pairs, and produces the same
result regardless of whitespace or object field order. It uses POSIX
`fold` to bound awk record sizes so compact responses stay fast across
awk implementations.

Fixes #31520.

## Changes

- replace line-oriented release metadata matching with structure-aware
parsing
- reuse the parsed metadata for latest-version and asset-digest lookup
- add regression coverage for compact JSON, reordered fields, nested
decoys, and JSON-looking release text

## Design decisions

- Keep the installer dependency-free by using standard POSIX tools
already required by the shell installer.
- Parse only the GitHub release fields the installer consumes, in one
pass, instead of vendoring a general JSON library.
- Preserve asset-object boundaries so nested or string-encoded `name`
and `digest` fields cannot be mistaken for release assets.

## Testing

- Tests: focused installer suite locally and on Linux.
- Smoke tests: real pretty and compact GitHub release metadata,
latest-release resolution, and checksum-asset selection.
- Portability: macOS awk plus Linux gawk, mawk, and nawk.
- Stress coverage: randomized formatting and field order, adversarial
nested/string content, and a synthetic 2,000-asset compact response.
Installer needs to symlink code-mode-host next to codex on install.
…ernal process (#31899)

## Why

Not every Codex distribution currently includes the
`codex-code-mode-host` companion binary. Enabling the process-host
feature should not make code mode unavailable on those surfaces while
packaging support is being completed.

## What changed

- Fall back to an in-process code-mode session only when spawning the
companion binary returns `io::ErrorKind::NotFound`.
- Keep permission, handshake, timeout, and other host failures visible
instead of silently falling back.
- Store the provider's owned-process/in-process choice as one
enum-backed state so later sessions reuse the fallback decision.
- Preserve the underlying spawn `io::Error` while retaining the host
path in the displayed error.
- Update provider, `CodeModeService`, and end-to-end coverage to verify
successful fallback execution.

## Test plan

- `just test -p codex-code-mode`
- `just test -p codex-core missing_process_host`
@bolinfest bolinfest changed the title [0.144] Backport installer metadata and Darwin code-mode fixes [0.144] Backport installer and code-mode reliability fixes Jul 9, 2026
@bolinfest

Copy link
Copy Markdown
Collaborator Author

Created PR only for CI, not for the purpose of merging.

@bolinfest bolinfest closed this Jul 9, 2026
github-actions Bot pushed a commit that referenced this pull request Jul 9, 2026
- Fixed standalone installs failing when GitHub returns compact or reordered release metadata. (#31913)
- Ensured macOS package installs expose the code-mode host alongside the `codex` executable. (#31913)
- Kept code mode working when the companion host binary is unavailable by falling back to the embedded runtime. (#31913)

## Changelog

Full Changelog: rust-v0.144.0...rust-v0.144.1

- #31913 [0.144] Backport installer and code-mode reliability fixes @bolinfest
Pimpmuckl pushed a commit to Pimpmuckl/codex that referenced this pull request Jul 10, 2026
- Fixed standalone installs failing when GitHub returns compact or reordered release metadata. (openai#31913)
- Ensured macOS package installs expose the code-mode host alongside the `codex` executable. (openai#31913)
- Kept code mode working when the companion host binary is unavailable by falling back to the embedded runtime. (openai#31913)

## Changelog

Full Changelog: openai/codex@rust-v0.144.0...rust-v0.144.1

- openai#31913 [0.144] Backport installer and code-mode reliability fixes @bolinfest
Haleclipse added a commit to Haleclipse/codex that referenced this pull request Jul 12, 2026
## Bug Fixes

- Fixed standalone installs failing when GitHub returns compact or reordered release metadata. (openai#31913)
- Ensured macOS package installs expose the code-mode host alongside the `codex` executable. (openai#31913)
- Kept code mode working when the companion host binary is unavailable by falling back to the embedded runtime. (openai#31913)

## Changelog

Full Changelog: openai/codex@rust-v0.144.0...rust-v0.144.1

## Cometix Adaptations

- Keep workspace version at upstream 0.144.1 for main
- No workflow pollution introduced
- Preserve cometix customizations
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.

3 participants