Skip to content

package code mode host as a managed resource#31890

Open
cconger wants to merge 6 commits into
mainfrom
cconger/fix-code-mode-host-resources
Open

package code mode host as a managed resource#31890
cconger wants to merge 6 commits into
mainfrom
cconger/fix-code-mode-host-resources

Conversation

@cconger

@cconger cconger commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Why

codex-code-mode-host is a managed runtime dependency, not a user-facing entrypoint. Packaging it with entrypoint binaries and resolving it relative to the running executable made its location depend on the install format. That was especially fragile across npm, standalone, and direct Linux bundles.

The host should live with the other managed resources and be resolved through InstallContext, which already owns knowledge of the active package layout.

What changed

  • Package codex-code-mode-host under codex-resources/ in canonical archives on every platform, and in the direct Linux release bundle alongside bwrap.
  • Resolve the host through InstallContext. Code mode uses the in-process implementation when the active installation does not provide a managed host; it no longer uses an environment override or searches next to the Codex executable.
  • Recognize directly extracted Linux bundles as an explicit install method so both the code-mode host and bwrap resolve from their codex-resources/ directory.
  • Update the shell and PowerShell installers, release verification, package construction, and Python SDK artifact plumbing for the resource layout. The shell installer no longer creates a visible host symlink.
  • Keep installer validation compatible with packages that placed the host under bin/, while all newly produced packages use codex-resources/.

Testing

  • Added package-layout coverage for the host resource on Linux, macOS, and Windows targets.
  • Added installer and Python SDK artifact tests for the new archive layout.
  • Added InstallContext coverage for canonical packages, direct Linux bundles, missing resources, and Windows path normalization.
  • Updated code-mode provider tests for managed-host and in-process resolution.

@cconger cconger requested a review from a team as a code owner July 9, 2026 20:40

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 47a3d2fa93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/code-mode/src/remote_session.rs Outdated
Comment thread scripts/install/install.sh Outdated
@cconger cconger force-pushed the cconger/fix-code-mode-host-resources branch from 47a3d2f to 2c89649 Compare July 9, 2026 20:53
Comment thread codex-rs/install-context/src/lib.rs Outdated
Comment thread codex-rs/install-context/src/lib.rs Outdated
Comment thread codex-rs/install-context/src/lib.rs Outdated
mkdir -p "$bundle_root/codex-resources"
cp "$dest/codex-${{ matrix.target }}" "$bundle_root/codex"
cp "$dest/codex-code-mode-host-${{ matrix.target }}" "$bundle_root/codex-code-mode-host"
cp "$dest/codex-code-mode-host-${{ matrix.target }}" "$bundle_root/codex-resources/codex-code-mode-host"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having logic for codex-code-mode-host in this Linux-specific block feels wrong to me. Shouldn't the logic for this be universal to all three platforms?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is for the special "legacy" codex bundle for linux where we have a tarball with the binary at the top level. I think we should probably look at deprecating this release for the codex-package for linux.

@cconger cconger force-pushed the cconger/fix-code-mode-host-resources branch from 2c89649 to 8fc5ae3 Compare July 9, 2026 23:57
@cconger cconger changed the title fix code mode host resource installation package code mode host as a managed resource Jul 10, 2026
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.

2 participants