Skip to content

fix(cli): parse codex plugin list text output instead of --json#314

Merged
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:fix/codex-plugin-list-json
Jun 27, 2026
Merged

fix(cli): parse codex plugin list text output instead of --json#314
rapids-bot[bot] merged 3 commits into
NVIDIA:mainfrom
zhongxuanwang-nv:fix/codex-plugin-list-json

Conversation

@zhongxuanwang-nv

@zhongxuanwang-nv zhongxuanwang-nv commented Jun 25, 2026

Copy link
Copy Markdown
Member

Overview

nemo-relay doctor --plugin codex (and --plugin all) fails on Codex CLI 0.136.0 with error: unexpected argument '--json' found. The codex plugin host-registration probe calls codex plugin list --json, but current Codex plugin list has no --json flag (only -c, -m/--marketplace, --enable, --disable).

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • codex_plugin_registered now runs codex plugin list (no --json) and parses the text table, mirroring the existing codex_marketplace_registered text parsing. A small helper codex_plugin_line_installed matches the row whose first column is nemo-relay-plugin@nemo-relay-local and whose status column starts with installed (so installed, enabled matches but not installed does not).
  • Claude Code is unchanged and still uses --json, since its CLI supports it.
  • Updated plugin_install tests to mock the Codex text output, added not-installed and wrong-marketplace negative cases, and moved the JSON parse-error assertion to the Claude path (Codex no longer has a JSON parse path).

Validation (isolated worktree off main):

  • cargo test -p nemo-relay-cli plugin_install — 34 passed
  • cargo clippy -p nemo-relay-cli --all-targets — clean
  • cargo fmt -- --check — clean
  • pre-commit hooks passed on commit

Where should the reviewer start?

crates/cli/src/plugin_install/host.rscodex_plugin_registered and the new codex_plugin_line_installed helper.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

Summary by CodeRabbit

  • Bug Fixes

    • Improved Codex plugin registration detection by reading the standard (non-JSON) plugin list table output instead of relying on JSON parsing.
    • Strengthened matching to require the correct plugin name and marketplace pairing, reducing incorrect registrations.
    • Updated behavior when the plugin list output format can’t be parsed, so errors are surfaced as expected.
  • Tests

    • Revised plugin installation and coverage tests to mock the text table output and validate installed, not installed, and mismatched marketplace scenarios.

Codex CLI 0.136.0's `codex plugin list` has no `--json` flag, so the codex
plugin host-registration probe in `nemo-relay doctor --plugin codex` (and
`--plugin all`) failed with "unexpected argument '--json' found".

Parse the `codex plugin list` text table instead, matching the existing
`codex_marketplace_registered` text parsing. Claude Code keeps `--json`
because its CLI still supports it.

Fixes NVIDIA#313

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 562c3b04-6f94-4e44-baeb-6d3019bb035a

📥 Commits

Reviewing files that changed from the base of the PR and between be06cea and df5e275.

📒 Files selected for processing (2)
  • crates/cli/src/plugin_install/host.rs
  • crates/cli/tests/coverage/plugin_install_tests.rs
💤 Files with no reviewable changes (1)
  • crates/cli/tests/coverage/plugin_install_tests.rs
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (8)
**/*.rs

📄 CodeRabbit inference engine (.agents/skills/add-binding-feature/SKILL.md)

Use snake_case naming convention for Rust identifiers (e.g., nemo_relay_tool_call)

**/*.rs: Any Rust change must run just test-rust
Any Rust change must run cargo fmt --all
Any Rust change must run cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all for all FFI work since it is Rust work
Run just test-rust to validate FFI changes
Run cargo clippy --workspace --all-targets -- -D warnings to enforce strict linting on FFI work

When Rust files changed as part of Go work, also run cargo fmt --all, just test-rust, and cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Run cargo fmt --all when Rust files are changed as part of Node work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files are changed as part of Node work
Run just test-rust when Rust files are changed as part of Node work

**/*.rs: Run cargo fmt --all to format all Rust code
Run cargo clippy --workspace --all-targets -- -D warnings to enforce all clippy lints as errors

**/*.rs: Run cargo fmt --all when Rust files changed as part of WebAssembly work
Run cargo clippy --workspace --all-targets -- -D warnings when Rust files changed as part of WebAssembly work

**/*.rs: If any Rust code changed, always run just test-rust
If any Rust code changed, also run cargo fmt --all
If any Rust code changed, also run cargo clippy --workspace --all-targets -- -D warnings
Run Rust formatting with cargo fmt --all
Run Rust linting with cargo clippy --workspace --all-targets -- -D warnings

**/*.rs: Use cargo fmt for Rust code formatting
Run cargo clippy -- -D warnings to lint Rust code and treat all warnings as errors
Use Rust snake_case naming convention for Rust identifiers
Include SPDX license header in all Rust source files using double-slash comment syntax
Validate Rust code with uv run pre-commit run --all-files to enforce cargo fmt formatting check, cargo clippy lints, and cargo deny aud...

Files:

  • crates/cli/src/plugin_install/host.rs
**/{Cargo.toml,**/*.rs}

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Maintain consistency between Rust package names in Cargo.toml and their actual usage across the codebase

Files:

  • crates/cli/src/plugin_install/host.rs
**/*.{h,hpp,c,cpp,rs}

📄 CodeRabbit inference engine (.agents/skills/maintain-packaging/SKILL.md)

Ensure FFI header and library naming follows consistent conventions across platform-specific builds

Files:

  • crates/cli/src/plugin_install/host.rs
**/*.{rs,toml}

📄 CodeRabbit inference engine (.agents/skills/rename-surfaces/SKILL.md)

Update Rust crate names and module prefixes during coordinated rename operations

Files:

  • crates/cli/src/plugin_install/host.rs
**/*.{rs,py,js,ts,tsx,jsx,go,sh,toml,yaml,yml,md}

📄 CodeRabbit inference engine (AGENTS.md)

Keep SPDX headers on source, docs, scripts, and configuration files. The project is Apache-2.0.

Files:

  • crates/cli/src/plugin_install/host.rs
**/*.{rs,py,go,js,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions: Rust and Python use snake_case, C FFI exports prefixed nemo_relay_, Go uses PascalCase for public APIs, Node.js uses camelCase.

Files:

  • crates/cli/src/plugin_install/host.rs
crates/**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

crates/**/*.rs: Keep async behavior on the existing tokio-based model. Bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.
Use Json = serde_json::Value in Rust-facing runtime APIs for JSON payload handling.

Files:

  • crates/cli/src/plugin_install/host.rs
**

⚙️ CodeRabbit configuration file

**:

AGENTS.md

This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.

Project Overview

NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go, WebAssembly, and the raw C FFI are experimental and source-first.

The shared runtime model is:

  1. Scope stacks decide where work belongs and which scope-local behavior is visible.
  2. Middleware registries decide what guardrails and intercepts run around managed calls.
  3. Plugins install reusable runtime behavior from configuration.
  4. Events record runtime behavior in ATOF form.
  5. Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.

Repository Structure

The repository layout separates the Rust runtime, language bindings, documentation,
integration patches, and agent-facing skills.

crates/
  core/       # Rust core runtime crate, published as nemo-relay
  adaptive/   # Adaptive runtime primitives and plugin components
  python/     # PyO3 native extension for the Python package
  ffi/        # Raw C ABI layer used by downstream bindings such as Go
  node/       # NAPI Node.js binding and JavaScript/TypeScript entry points
  wasm/       # wasm-bindgen WebAssembly binding and JS wrappers
python/
  nemo_relay/  # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers
  tests/      # Python tests
go/
  nemo_relay/  # Experimental Go CGo binding and tests
fern/         # Fern documentation site
scripts/      # Stable wrappers and helper scripts; build/test/docs entry points live in justfile
third_party/  # P...

Files:

  • crates/cli/src/plugin_install/host.rs
🔇 Additional comments (2)
crates/cli/src/plugin_install/host.rs (2)

219-230: LGTM!


223-230: 🎯 Functional Correctness

No change needed. codex plugin list uses the PLUGIN / STATUS / VERSION / PATH table, and the status values are lowercase (installed, enabled, installed, disabled, not installed), so the current whitespace-split check matches the CLI output.


Walkthrough

Codex plugin registration checks now read codex plugin list text output instead of JSON. Plugin install coverage was updated to match the new parsing rules, command invocation, and error handling.

Changes

Codex plugin list parsing

Layer / File(s) Summary
Host registration parsing
crates/cli/src/plugin_install/host.rs
codex_plugin_registered now invokes codex plugin list without --json and checks each output row with a whitespace-based installed-row predicate.
Coverage updates
crates/cli/tests/coverage/plugin_install_tests.rs
Plugin install coverage updates Codex mocked output, registration cases, non-JSON error handling, and the expected quiet-report command list.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the Codex plugin-list parsing change.
Description check ✅ Passed The PR description includes the required overview, details, reviewer start, and related issue sections.
Linked Issues check ✅ Passed Codex host registration now avoids --json and parses plugin list text output, addressing the Codex 0.136.0 integration failure in #313.
Out of Scope Changes check ✅ Passed The changes stay focused on Codex plugin detection and matching tests, with no unrelated code paths introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M PR is medium Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code labels Jun 25, 2026
Comment thread crates/cli/tests/coverage/plugin_install_tests.rs Outdated
@willkill07 willkill07 added this to the 0.5 milestone Jun 25, 2026
Codex no longer parses JSON after the --json removal, so move the
parse_json_command_output parse-error assertion out of the codex-focused
helper test and into host_registration_report_surfaces_capture_status_and_stderr_variants,
keeping the coverage with the host (Claude Code) that still uses --json.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@zhongxuanwang-nv zhongxuanwang-nv marked this pull request as ready for review June 25, 2026 21:26
@zhongxuanwang-nv zhongxuanwang-nv requested a review from a team as a code owner June 25, 2026 21:26
Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
@willkill07

Copy link
Copy Markdown
Member

/merge

@rapids-bot rapids-bot Bot merged commit 0fa0794 into NVIDIA:main Jun 27, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug issue describes bug; PR fixes bug lang:rust PR changes/introduces Rust code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: codex integration error: unexpected argument '--json' found

2 participants