Skip to content

[WIP] Add Codex CLI and APM agent-skills to container images - #657

Open
not-stbenjam wants to merge 5 commits into
openshift-eng:mainfrom
not-stbenjam:add-codex-and-apm
Open

[WIP] Add Codex CLI and APM agent-skills to container images#657
not-stbenjam wants to merge 5 commits into
openshift-eng:mainfrom
not-stbenjam:add-codex-and-apm

Conversation

@not-stbenjam

@not-stbenjam not-stbenjam commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Install OpenAI Codex CLI as a standalone Rust binary from GitHub releases (~109 MB, statically linked, zero runtime deps) — avoids pulling in Node.js solely as a package manager for a single binary
  • Add apm-cli (pinned 0.26.0) and an apm.yml manifest declaring all ai-helpers plugins as dependencies targeting agent-skills
  • At build time, apm install --target agent-skills deploys plugin skills to .agents/skills/, making them discoverable by Codex and other agents following the agentskills.io convention

Test plan

  • Verify container builds successfully with Codex binary and APM install
  • Confirm codex --version works inside the container
  • Confirm apm CLI is available and apm.yml is parsed correctly
  • Verify .agents/skills/ is populated after build
  • Test Codex can discover and use the deployed agent-skills
  • Verify no regressions in Claude Code plugin functionality

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added OpenShift AI Helpers configuration to enable publishing a curated set of helper plugins.
    • Bundled agent skills into the container image and automated their installation for agent usage.
    • Added the Codex CLI to container images, with build-time selection of the Codex version.
  • Chores / Build

    • Improved container build steps by verifying the Codex CLI download with a SHA-256 checksum and pinning apm-cli.
    • Updated plugin installation to target the image workspace.
    • Updated Skillsaw rules to disable a structure check that could produce a false positive.

Install the OpenAI Codex CLI as a standalone Rust binary from GitHub
releases (~109 MB, zero runtime deps, musl-linked). This avoids pulling
in Node.js solely as a delivery vehicle for a single binary.

Add apm-cli (pinned 0.26.0) and an apm.yml manifest that declares all
ai-helpers plugins as dependencies targeting agent-skills. At build time
`apm install --target agent-skills` deploys the same plugin skills that
Claude Code uses to the .agents/skills/ convention, making them
discoverable by Codex and other agents that follow the agentskills.io
standard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: not-stbenjam
Once this PR has been reviewed and has the lgtm label, please assign dgoodwin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

Hi @not-stbenjam. Thanks for your PR.

I'm waiting for a openshift-eng member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 74e31fc9-421c-4782-a2fe-edd76fe1b4cd

📥 Commits

Reviewing files that changed from the base of the PR and between 706b46b and 7c623e1.

📒 Files selected for processing (2)
  • images/Dockerfile
  • images/Dockerfile.nested-podman

Walkthrough

Adds the ai-helpers package manifest, installs the checksum-verified Codex CLI and apm-cli in both image variants, configures agent-skills plugin deployment under /workspace, and disables the related Skillsaw validation rule.

Changes

Agent skills container integration

Layer / File(s) Summary
Package manifest and validation configuration
apm.yml, .skillsaw.yaml
Defines package metadata, agent-skills deployment, selected plugins, automatic includes, and the disabled structure-validation rule.
Container tooling installation
images/Dockerfile, images/Dockerfile.nested-podman
Installs the versioned Codex CLI with SHA-256 verification and pinned apm-cli==0.26.0 in both image variants.
Agent-skills plugin deployment
images/Dockerfile, images/Dockerfile.nested-podman
Runs apm install for the agent-skills target with /workspace as the installation root.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DockerBuild
  participant CodexRelease
  participant PythonEnvironment
  participant APMCLI
  participant Workspace
  DockerBuild->>CodexRelease: Download versioned Codex musl tarball
  CodexRelease-->>DockerBuild: Return checksum-verified archive
  DockerBuild->>PythonEnvironment: Install apm-cli 0.26.0
  DockerBuild->>APMCLI: Run install for agent-skills with root /workspace
  APMCLI->>Workspace: Deploy configured plugins
Loading

Suggested labels: do-not-merge/work-in-progress, needs-ok-to-test

Suggested reviewers: cblecker, theobarberbany, stbenjam

🚥 Pre-merge checks | ✅ 10
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding Codex CLI and APM agent-skills support to the container images.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Real People Names In Style References ✅ Passed The changed files contain no real-person names used as style references or examples; only policy text mentions the rule and the new configs use product names/technical terms.
No Assumed Git Remote Names ✅ Passed The changed files only add Codex/APM setup and Skillsaw config; none contain hardcoded git remote names or git push/fetch commands.
Git Push Safety Rules ✅ Passed No git push commands found in any files modified by this PR. The changes only involve Docker configuration, package management, and agent skills deployment without any autonomous or unsafe git oper...
No Untrusted Mcp Servers ✅ Passed Changed files only add mcp: [] in apm.yml; Dockerfiles add Codex/apm installs but no MCP server install commands or new MCP deps.
Ai-Helpers Overlap Detection ✅ Passed PR changes apm.yml, Dockerfiles, and .skillsaw.yaml only; no plugins//commands/.md, plugins//skills//SKILL.md, or agents/*.md overlap to assess.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Only include the 3 plugins pre-enabled in claude-settings.json:
ci, hello-world, and jira.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apm.yml`:
- Around line 7-46: Make APM dependency resolution reproducible by pinning every
plugin reference under dependencies.apm in apm.yml to immutable commits, or
generate and commit apm.lock.yaml containing those resolved commits. Ensure the
Dockerfile install flow uses the pinned lockfile or refs so rebuilds cannot
resolve floating plugin revisions.

In `@images/Dockerfile`:
- Around line 69-71: The agent-skills installation in images/Dockerfile and
images/Dockerfile.nested-podman currently targets /opt/ai-helpers instead of the
runtime workspace. Update both Dockerfiles so the installed .agents/skills
output is available under /workspace for Codex discovery, either by installing
from the workspace or copying the generated skills there.
- Around line 39-45: Add Codex release archive digest validation before
extraction in the install blocks at images/Dockerfile lines 39-45 and
images/Dockerfile.nested-podman lines 42-47. Fetch the official checksum and
verify the downloaded tarball before invoking tar, or replace both blocks with
Codex’s official installer that performs validation; preserve the existing
versioned release installation and final /usr/local/bin/codex path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d170b1a-62d6-49e9-a8fc-8a9d7ce29f1c

📥 Commits

Reviewing files that changed from the base of the PR and between 316acea and 0715ae9.

📒 Files selected for processing (3)
  • apm.yml
  • images/Dockerfile
  • images/Dockerfile.nested-podman

Comment thread apm.yml Outdated
Comment thread images/Dockerfile
Comment thread images/Dockerfile
The rule fires on a consumer-only apm.yml that has no .apm/ directory,
which is expected for manifests that only declare dependencies to
install rather than authoring APM content.

Filed: stbenjam/skillsaw#472

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use --root /workspace so apm installs .agents/skills/ where Codex
looks for them at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@not-stbenjam

Copy link
Copy Markdown
Contributor Author

Tested: Codex discovers ai-helpers skills

Built the image locally (with a public base image since CI builder requires auth) and confirmed Codex picks up all deployed agent-skills via /skills:

$ podman run --rm -w /workspace ai-helpers sh -c 'git init && codex exec /skills'

OpenAI Codex v0.146.0
--------
workdir: /workspace
model: gpt-5.6-sol
provider: openai
--------
user
/skills

codex
Available skills:

- Jira: `create`, `fetch-jira-issue`, `ready-to-solve`, `catch-me-up`, `status-analysis`,
  `categorize-activity-types`, `jira-conventions`, `jira-doc-generator`, `jira-issues-by-component`,
  `jira-validate-blockers`, `set-release-blocker`, `add-jira-triage-link`
- Component Readiness: `triage-regression`, `bulk-triage-regressions`, `fetch-regression-details`,
  `fetch-related-triages`, `fetch-test-report`, `fetch-test-runs`
- OpenShift payloads: `payload-analysis`, `payload-snapshot`, `payload-results-yaml`,
  `payload-autodl-json`, `fetch-payloads`, `fetch-new-prs-in-payload`, `fetch-releases`,
  `stage-payload-reverts`, `payload-experimental-reverts`, `trigger-payload-job`
- Prow/CI diagnostics: `prow-job-analysis`, `prow-job-analyze-resource`, `fetch-prowjob-json`,
  `fetch-job-run-summary`, `detect-permafail`, `analyze-disruption`
- GitHub/release work: `extract-prs`, `revert-pr`, `create-release-note`
- Documentation: `generate-enhancement`
- OpenShift authentication: `oc-auth`

39 skills from the ci, jira, and hello-world plugins are deployed to /workspace/.agents/skills/ at build time via apm install --target agent-skills --root /workspace.

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
images/Dockerfile (1)

39-45: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make Codex installation architecture-aware in both images.

Both Dockerfiles hard-code the Linux x86_64 Codex archive URL, which means arm64 builds extract the wrong release binary. Use TARGETARCH to select the corresponding arm64/x86_64 asset, or explicitly restrict these images to amd64.

  • images/Dockerfile#L39-L45
  • images/Dockerfile.nested-podman#L42-L47
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@images/Dockerfile` around lines 39 - 45, Make Codex installation
architecture-aware in the RUN blocks of images/Dockerfile lines 39-45 and
images/Dockerfile.nested-podman lines 42-47 by using TARGETARCH to select the
matching arm64 or x86_64 archive and binary name. Apply the same architecture
mapping in both Dockerfiles, or explicitly restrict both images to amd64.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@images/Dockerfile`:
- Around line 39-45: Make Codex installation architecture-aware in the RUN
blocks of images/Dockerfile lines 39-45 and images/Dockerfile.nested-podman
lines 42-47 by using TARGETARCH to select the matching arm64 or x86_64 archive
and binary name. Apply the same architecture mapping in both Dockerfiles, or
explicitly restrict both images to amd64.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 37327ecc-bcb6-4a7a-974f-32092f53c936

📥 Commits

Reviewing files that changed from the base of the PR and between 13eb1b6 and 706b46b.

📒 Files selected for processing (3)
  • .skillsaw.yaml
  • images/Dockerfile
  • images/Dockerfile.nested-podman

Download to a temp file and check the digest against a pinned
CODEX_SHA256 build arg before extracting, addressing the CodeRabbit
supply-chain security comment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant