Skip to content

docs(cli): explain shim-free Codex token injection boundaries (#2713) - #3208

Merged
lidge-jun merged 1 commit into
devfrom
codex/shim-free-token-docs-2713
Sep 1, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/shim-free-token-docs-2713

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Closes the documentation slice that remained on feat(ocx): native token injection for Codex without the wrapper shim (systemd --user drop-in or equivalent) #2713 after the ocx doctor diagnostic landed in fix(doctor): diagnose the broken Codex env_key launch path #2844. New "Token injection without the shim" subsection under ocx codex-shim in reference/cli/lifecycle.md.
  • States the process boundary the reporter validated: env_key names a variable but does not create it; the shim or an export in the process that launches Codex (shell profile, cron line, a unit that starts Codex) carries OPENCODEX_API_AUTH_TOKEN; EnvironmentFile=/OCX_API_TOKEN_FILE on opencodex-proxy.service configures only the proxy and never reaches an independent codex exec.
  • Points to the existing token file, warns against copying the value into config.toml, and names the ocx doctor "Codex env_key launch readiness" line as the detector. No new commands or config keys; a first-class ocx codex-env is declined per the maintainer review (a systemd --user default does not fit root-owned servers, and the launcher path is the exact hole the issue reports).

Closes #2713

Verification

  • bun run privacy:scan passed; bun run skill:surface:check current (no CLI surface change).
  • bun test tests/doctor-codex-envkey-readiness.test.ts → 8 pass (sanity for the referenced diagnostic; no code change).
  • Full suite runs in CI on this PR.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Documentation
    • Added lifecycle guidance for injecting authentication tokens into Codex without the shim.
    • Clarified supported and unsupported token-delivery methods and process boundaries.
    • Documented upgrade-related failures and recovery guidance using ocx doctor.
    • Added audit and adoption-plan documentation confirming no runtime changes.

Records what does and does not carry OPENCODEX_API_AUTH_TOKEN into a
Codex process launched independently of the proxy, why EnvironmentFile=
on the proxy unit cannot, and where ocx doctor reports the broken
env_key launch path (landed in #2844).
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 1, 2026 19:44
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun merged commit e1eb8c5 into dev Sep 1, 2026
7 of 8 checks passed
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 1, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T19:48:15.079050Z f5080c3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun deleted the codex/shim-free-token-docs-2713 branch September 1, 2026 19:44
@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 3f36c56e-4bb5-4ff4-bbe1-66ad24143321

📥 Commits

Reviewing files that changed from the base of the PR and between 4a382be and f5080c3.

📒 Files selected for processing (3)
  • devlog/_plan/260902_nonbug_adoption_backlog/070_wp7_shim_free_token.md
  • devlog/_plan/260902_nonbug_adoption_backlog/071_wp7_audit_r1_synthesis.md
  • docs-site/src/content/docs/reference/cli/lifecycle.md

📝 Walkthrough

Walkthrough

The pull request adds WP7 planning and audit records, then documents shim-free Codex token injection in the CLI lifecycle reference. It describes process boundaries, supported and unsupported injection methods, shim replacement after Codex upgrades, and ocx doctor diagnostics.

Changes

WP7 token injection documentation

Layer / File(s) Summary
Design plan and audit evidence
devlog/_plan/260902_nonbug_adoption_backlog/070_wp7_shim_free_token.md, devlog/_plan/260902_nonbug_adoption_backlog/071_wp7_audit_r1_synthesis.md
The plan records the resolved token-injection design, rejected runtime approaches, documentation scope, and acceptance criteria. The audit synthesis records the review evidence and docs-only closure verdict.
Lifecycle token injection reference
docs-site/src/content/docs/reference/cli/lifecycle.md
The lifecycle reference documents the OPENCODEX_API_AUTH_TOKEN process environment requirement, supported shim and export paths, unsupported proxy-only configuration, Codex upgrade behavior, and token-safe ocx doctor guidance.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: ingwannu

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/shim-free-token-docs-2713

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f5080c3a89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +434 to +435
the cron line, or an `Environment=`/`EnvironmentFile=` on the systemd unit that launches
**Codex** (not the proxy). Point it at the existing token file; do not copy the value into

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Do not point EnvironmentFile at the raw token file

For the documented systemd-unit path, this wording directs users to set EnvironmentFile=$OPENCODEX_HOME/service-api-token, but writeServiceApiTokenFile() writes only the raw token plus a newline (src/lib/service-secrets.ts:52-65), while systemd's EnvironmentFile= format requires newline-separated variable assignments. Consequently the Codex unit receives no OPENCODEX_API_AUTH_TOKEN and still fails with the missing-variable error. Document an ExecStart wrapper that reads and exports the raw file, or require a separate protected OPENCODEX_API_AUTH_TOKEN=... environment file instead.

AGENTS.md reference: docs-site/AGENTS.md:L7-L10

Useful? React with 👍 / 👎.

tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…jun#2713) (lidge-jun#3208)

Records what does and does not carry OPENCODEX_API_AUTH_TOKEN into a
Codex process launched independently of the proxy, why EnvironmentFile=
on the proxy unit cannot, and where ocx doctor reports the broken
env_key launch path (landed in lidge-jun#2844).

Co-authored-by: jun <jun@lidge.dev>
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…jun#2713) (lidge-jun#3208)

Records what does and does not carry OPENCODEX_API_AUTH_TOKEN into a
Codex process launched independently of the proxy, why EnvironmentFile=
on the proxy unit cannot, and where ocx doctor reports the broken
env_key launch path (landed in lidge-jun#2844).

Co-authored-by: jun <jun@lidge.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant