Fix Codex CLI examples for containerized GitLab runners#2484
Open
lavrovpy wants to merge 1 commit intoopenai:mainfrom
Open
Fix Codex CLI examples for containerized GitLab runners#2484lavrovpy wants to merge 1 commit intoopenai:mainfrom
lavrovpy wants to merge 1 commit intoopenai:mainfrom
Conversation
Update all three YAML snippets in the GitLab cookbook to fix two issues that break Codex in CI: 1. Add `codex login --with-api-key` — Codex CLI no longer reads OPENAI_API_KEY implicitly from the environment (openai/codex#3367). 2. Replace `--full-auto` with `--dangerously-bypass-approvals-and-sandbox` — containerized runners (k8s, Docker) lack landlock/seccomp kernel features required by Codex's default workspace-write sandbox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates all three YAML snippets in
examples/codex/secure_quality_gitlab.mdto fix two issues that break Codex CLI in containerized CI environments:printenv OPENAI_API_KEY | codex login --with-api-keyto all three examples, per the CLI Reference.--full-autowith--dangerously-bypass-approvals-and-sandboxbecause containerized runners (Kubernetes pods, Docker) lack the kernel features (landlock, seccomp) that Codex's defaultworkspace-writesandbox requires. The Security docs recommend this flag when running inside containers that already provide isolation.Both issues cause Codex to silently produce empty results (
[]) with no clear error, making them hard to diagnose.Changes
printenv OPENAI_API_KEY | codex login --with-api-keyin all three job examplescodex exec --full-autowithcodex exec --dangerously-bypass-approvals-and-sandboxin all three job examples