mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
[codex] bundle code mode host in release packages (#30202)
## Summary - build, strip, sign, and publish `codex-code-mode-host` with the primary Codex release binaries on Linux, macOS, and Windows - place the host beside `codex[.exe]` in canonical package archives, macOS DMGs, and the legacy Linux bundle so the runtime's sibling lookup succeeds - preserve and validate the host through standalone installers and Python runtime wheel staging - add package-builder coverage for source selection and the resulting package layout ## Why The process-owned code-mode client launches `codex-code-mode-host` as a sibling of the running Codex executable. Release artifacts currently build and bundle `codex` without that host, so code mode cannot start from installed packages.
This commit is contained in:
@@ -53,6 +53,10 @@ def runtime_binary_name() -> str:
|
||||
return "codex.exe" if _is_windows() else "codex"
|
||||
|
||||
|
||||
def runtime_code_mode_host_name() -> str:
|
||||
return "codex-code-mode-host.exe" if _is_windows() else "codex-code-mode-host"
|
||||
|
||||
|
||||
def staged_runtime_package_root(root: Path) -> Path:
|
||||
return root / RUNTIME_PACKAGE_ROOT
|
||||
|
||||
@@ -276,6 +280,9 @@ def _validate_codex_package_layout(package_dir: Path, package_archive: Path) ->
|
||||
package_binary = package_dir / "bin" / runtime_binary_name()
|
||||
if not package_binary.is_file():
|
||||
missing_entries.append(str(Path("bin") / runtime_binary_name()))
|
||||
code_mode_host = package_dir / "bin" / runtime_code_mode_host_name()
|
||||
if not code_mode_host.is_file():
|
||||
missing_entries.append(str(Path("bin") / runtime_code_mode_host_name()))
|
||||
if missing_entries:
|
||||
missing = ", ".join(missing_entries)
|
||||
raise RuntimeError(f"Missing Codex package layout entries in {package_archive}: {missing}")
|
||||
|
||||
@@ -57,6 +57,7 @@ def _write_fake_codex_package(package_dir: Path, script) -> Path:
|
||||
(package_dir / "codex-path").mkdir()
|
||||
(package_dir / "codex-package.json").write_text('{"variant":"codex"}\n')
|
||||
(package_dir / "bin" / script.runtime_binary_name()).write_text("fake codex\n")
|
||||
(package_dir / "bin" / script.runtime_code_mode_host_name()).write_text("fake code mode host\n")
|
||||
(package_dir / "codex-resources" / "bwrap").write_text("fake bwrap\n")
|
||||
(package_dir / "codex-path" / "rg").write_text("fake rg\n")
|
||||
return package_dir
|
||||
@@ -682,11 +683,13 @@ def test_stage_runtime_release_copies_package_layout_and_sets_version(
|
||||
assert {
|
||||
"metadata": (package_root / "codex-package.json").read_text(),
|
||||
"codex": (package_root / "bin" / script.runtime_binary_name()).read_text(),
|
||||
"code_mode_host": (package_root / "bin" / script.runtime_code_mode_host_name()).read_text(),
|
||||
"bwrap": (package_root / "codex-resources" / "bwrap").read_text(),
|
||||
"rg": (package_root / "codex-path" / "rg").read_text(),
|
||||
} == {
|
||||
"metadata": '{"variant":"codex"}\n',
|
||||
"codex": "fake codex\n",
|
||||
"code_mode_host": "fake code mode host\n",
|
||||
"bwrap": "fake bwrap\n",
|
||||
"rg": "fake rg\n",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user