Conversation
Greptile SummaryThis PR integrates the OpenAI Codex CLI as a new Key findings:
Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| pkg/agentrun-harness/tool/codex/codex.go | Core Codex tool implementation. Two issues: (1) ensure() does not validate consoleToken in proxy mode, allowing a silent auth failure at runtime; (2) mapStreamItem has no handler for "message" type items, so assistant text responses are silently dropped and never forwarded to the console. |
| pkg/agentrun-harness/tool/codex/model.go | Defines model constants and DefaultModel() with env-driven override. Default model is gpt-5; the model whitelist also includes gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5.2-codex, and codex-mini-latest. |
| pkg/agentrun-harness/tool/codex/codex_types.go | Type definitions for the Codex struct, streaming event types, TOML config types, and input helpers. Well-structured with clear comments on each event field. |
| pkg/agentrun-harness/tool/codex/codex_templates.go | Builds and writes the Codex config.toml via go-toml. Correctly creates profiles, MCP server entries, model provider entries, and project trust-level entries. |
| dockerfiles/agent-harness/codex.Dockerfile | Multi-stage Docker build that installs the @openai/codex npm package, promotes nested native binaries to the top-level @openai scope, and copies the result into the agent-harness base image. Includes a workaround for Node module resolution with native platform packages. |
| api/v1alpha1/agentruntime_types.go | Adds CodexConfig, CodexConfigRaw, and ToCodexConfigRaw() following the same pattern as existing Claude/Gemini types. ToAgentRuntimeConfigRaw is correctly extended to include Codex. |
Last reviewed commit: 78238f4
charts/deployment-operator/crds/deployments.plural.sh_agentruntimes.yaml
Show resolved
Hide resolved
…ent-runtime-handlers
…ent-runtime-handlers
…ent-runtime-handlers
…ent-runtime-handlers
…ent-runtime-handlers
There was a problem hiding this comment.
Pull request overview
Adds support for the OpenAI Codex CLI as a new AI agent runtime, following the existing patterns for Claude, Gemini, and OpenCode runtimes.
Changes:
- New
codextool package with CLI integration, config generation (TOML), model selection, and stream event parsing. - CRD, API types, controller, Dockerfile, CI workflow, and Makefile updates to wire Codex as a first-class runtime option.
- Sample
agentRuntime.yamlupdated (partially) to reference Codex.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/agentrun-harness/tool/codex/codex.go | Main Codex tool: configure, run, stream parsing |
| pkg/agentrun-harness/tool/codex/codex_types.go | Types for Codex config, stream events, MCP |
| pkg/agentrun-harness/tool/codex/codex_templates.go | Build and write TOML config for Codex |
| pkg/agentrun-harness/tool/codex/model.go | Model constants and default selection |
| pkg/agentrun-harness/tool/tool.go | Register codex in tool factory |
| pkg/agentrun-harness/tool/v1/tool.go | Add Codex system prompt dir |
| api/v1alpha1/agentruntime_types.go | CodexConfig/CodexConfigRaw types and conversion |
| api/v1alpha1/zz_generated.deepcopy.go | Generated deepcopy for new types |
| internal/controller/agentrun_controller.go | Env vars and secret handling for Codex |
| internal/controller/agentrun_pod.go | Codex image version mapping |
| config/crd/bases/…_agentruntimes.yaml | CRD schema for codex config |
| charts/…_agentruntimes.yaml | Helm CRD schema for codex config |
| dockerfiles/agent-harness/codex.Dockerfile | Multi-stage Dockerfile for Codex CLI |
| dockerfiles/agent-harness/base.Dockerfile | Create .codex dir in base image |
| config/samples/agentRuntime.yaml | Sample updated (incompletely) for Codex |
| Makefile | Build/run targets for Codex |
| .github/workflows/publish-agent-harness.yaml | CI matrix entries for Codex |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for the OpenAI Codex CLI as a new AI agent runtime type alongside existing Claude, Gemini, and OpenCode runtimes.
Changes:
- Adds a new
codexpackage implementing theToolinterface for running Codex CLI, including config generation (TOML), model selection, and stream event parsing. - Extends CRDs, API types, controller logic, and deep copy functions to support the new
CODEXruntime type with its configuration (API key, model). - Adds Dockerfile, CI workflow entries, and Makefile targets for building and publishing the Codex agent harness image.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/agentrun-harness/tool/codex/codex.go | Main Codex tool implementation: configure, run, stream parsing |
| pkg/agentrun-harness/tool/codex/codex_types.go | Type definitions for Codex config, stream events, MCP inputs |
| pkg/agentrun-harness/tool/codex/codex_templates.go | Config building and TOML writing helpers |
| pkg/agentrun-harness/tool/codex/model.go | Codex model enum and default model resolution |
| pkg/agentrun-harness/tool/tool.go | Register Codex in the tool factory |
| pkg/agentrun-harness/tool/v1/tool.go | Add Codex provider directory for system prompts |
| api/v1alpha1/agentruntime_types.go | Add CodexConfig/CodexConfigRaw types and enum update |
| api/v1alpha1/zz_generated.deepcopy.go | Generated deep copy for new Codex types |
| internal/controller/agentrun_controller.go | Add Codex env constants and secret data handling |
| internal/controller/agentrun_pod.go | Add Codex image version mapping |
| config/crd/bases/deployments.plural.sh_agentruntimes.yaml | CRD schema for Codex config |
| charts/deployment-operator/crds/deployments.plural.sh_agentruntimes.yaml | Helm chart CRD mirror |
| dockerfiles/agent-harness/codex.Dockerfile | Multi-stage Dockerfile for Codex CLI |
| dockerfiles/agent-harness/base.Dockerfile | Create .codex directory in base image |
| .github/workflows/publish-agent-harness.yaml | CI matrix entries for Codex builds |
| Makefile | Docker build and run targets for Codex |
| config/samples/agentRuntime.yaml | Sample updated to Codex |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Test Plan
Test environment: https://console.plrl-dev-aws.onplural.sh
Checklist