[0.144] Backport installer and code-mode reliability fixes - #31913
Closed
bolinfest wants to merge 3 commits into
Closed
[0.144] Backport installer and code-mode reliability fixes#31913bolinfest wants to merge 3 commits into
bolinfest wants to merge 3 commits into
Conversation
# 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`
Collaborator
Author
|
Created PR only for CI, not for the purpose of merging. |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
release/0.144branch needs three reliability fixes before the next patch release:codex-code-mode-host, but the installer did not expose it besidecodex.This draft PR targets
mainonly to run CI for the release branch. These fixes already exist onmain; the intended deliverable isrelease/0.144, and this PR should not be merged back intomain.What changed
awkscanner. This handles compact JSON, reordered fields, and nested or string-encoded decoys while fixing Update command failed with "Could not find Codex package or platform npm release assets for Codex $resolved_version." #31520.codex-code-mode-hostsymlink besidecodexfor macOS package installs.NotFound. Other host failures remain visible, and later sessions reuse the selected runtime mode.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.