Skip to content

fix(codex): swap to @agentclientprotocol/codex-acp 1.x + detect outdated adapter#1750

Open
wpfleger96 wants to merge 1 commit into
mainfrom
duncan/codex-acp-package-swap
Open

fix(codex): swap to @agentclientprotocol/codex-acp 1.x + detect outdated adapter#1750
wpfleger96 wants to merge 1 commit into
mainfrom
duncan/codex-acp-package-swap

Conversation

@wpfleger96

@wpfleger96 wpfleger96 commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Swaps the Codex ACP adapter from the deprecated @zed-industries/codex-acp (0.16.0, frozen 2026-06-08) to @agentclientprotocol/codex-acp (1.1.2). Fixes relay connectivity breakage introduced by the spawn-contract change in the new adapter, detects users still on the old adapter, and correctly merges per-persona and operator CODEX_CONFIG values without widening the sandbox for non-Codex agents.

What changed

Package swap (discovery.rs, README.md): @zed-industries/codex-acp@agentclientprotocol/codex-acp across all discovery, install hints, and docs.

Network config injection (config.rs): The 1.x adapter reads config exclusively from CODEX_CONFIG env (JSON blob) — the old -c key=value CLI args are silently dropped. codex_network_args (Vec of -c flags) is replaced with codex_network_env which injects CODEX_CONFIG={"sandbox_workspace_write":{"network_access":true}} via persona_env_vars. Config gains has_generated_codex_config: bool set when injection succeeds, used downstream to gate the merge path.

CODEX_CONFIG merge (acp.rs): build_codex_config_env replaces the old flat-spread with a recursive deep_merge (overlay wins on scalar/shape collisions, recurses on object+object so unrelated nested keys survive). The merge + network_access=true forcing only runs when has_generated_codex_config is true — persona-only CODEX_CONFIG values are never widened. AcpClient::spawn and all respawn paths thread the bool through.

AdapterOutdated detection (discovery.rs, readiness.rs, types.rs, setup_mode.rs, FE types + UI): Both discover_acp_runtimes and cli_login_requirements probe the codex binary version and return AdapterOutdated when < 1.0. The reinstall UI (SetupStep.tsx, DoctorSettingsPanel.tsx) shows a targeted nudge. configNudge.ts includes adapter_outdated as a valid requirement.

Stdout probe fix (discovery.rs): Replaced the non-blocking pipe read with a tempfile redirect to avoid O_NONBLOCK / Windows incompatibility in probe_codex_acp_major_version.

Install-plan seam (commands/agent_discovery.rs): Extracted pure plan_adapter_install for testable outcomes without real npm.

File-size gate (check-file-sizes.mjs): Ratcheted discovery.rs ceiling to 810 with justification comment.

@wpfleger96 wpfleger96 requested a review from a team as a code owner July 11, 2026 01:24
@wpfleger96 wpfleger96 force-pushed the duncan/codex-acp-package-swap branch from 3bf4ada to e112622 Compare July 11, 2026 01:57
@wpfleger96 wpfleger96 changed the title fix(codex): swap to @agentclientprotocol/codex-acp 1.x + fix network config injection fix(codex): swap to @agentclientprotocol/codex-acp 1.x + detect outdated adapter Jul 11, 2026
@wpfleger96 wpfleger96 force-pushed the duncan/codex-acp-package-swap branch 2 times, most recently from 30e8ac1 to c276da5 Compare July 11, 2026 02:55
…ted adapter

The @zed-industries/codex-acp package is deprecated (0.16.0, frozen 2026-06-08);
its README redirects to @agentclientprotocol/codex-acp (1.1.2, 2026-07-09).

The 1.x adapter changed config injection: the old adapter accepted `-c key=value`
CLI args; the 1.x arg dispatch only handles `--version`, `login`, and `cli` —
all other args fall through to startAcpServer(), which reads config exclusively
from `process.env["CODEX_CONFIG"]` (a JSON blob). Our three `-c` flags were
silently dropped, breaking relay connectivity (buzz-cli MCP subprocess blocked by
the Seatbelt sandbox). `network_proxy.mode` and `network_proxy.domains` are gone
from the 1.x schema; only `sandbox_workspace_write.network_access` is needed.

Without a version gate, users with the old 0.16.x adapter still on PATH would see
it as Available, receive the new CODEX_CONFIG spawn contract, and get silently
broken relay connectivity (0.16.x reads -c args, ignores env vars). Added
AdapterOutdated: version-probe (codex-acp --version) in discover_acp_runtimes and
cli_login_requirements blocks the old adapter and surfaces the reinstall nudge.

Note: #1745's config-parse classifier keys on codex's `error loading configuration`
+ `unknown variant` stderr wording. 1.x bundles @openai/codex@0.144.0; the wording
comes from that layer. Likely unchanged, noted as a dependency, not fixed here.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96 wpfleger96 force-pushed the duncan/codex-acp-package-swap branch from c276da5 to 3e6c6cb Compare July 11, 2026 03:04
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