Commit Graph

7 Commits

Author SHA1 Message Date
delta-cloud-208e
089f6e0be5 fix(codex): create wrapper before patcher runs
Patcher uses `which codex` to find binary. After migrating
codex -> .codex-bin, wrapper must exist before Step 2 (patcher)
or patcher fails with "Codex CLI not found".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:59:45 +00:00
delta-cloud-208e
deb1c2cfd2 fix(codex): drop Python 3.11 requirement, auto-install python3
- tomllib fallback: try tomllib (3.11+) -> tomli -> minimal parser
- Works with Python 3.8+ (Ubuntu 20.04, Debian 11, etc.)
- Auto-install python3 if not found (like Gemini/Qwen scripts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:58:16 +00:00
delta-cloud-208e
d37772d67c fix: wrapper scripts for all CLIs — env vars work immediately without source
Problem: `sudo bash install.sh` runs in child process, `export` inside it
never reaches the user's current shell. /etc/environment and /etc/profile.d/
only work for NEW sessions. So `codex`/`gemini`/`qwen` fail with
"Missing environment variable" right after install.

Solution: wrapper scripts that auto-source env file before exec'ing binary.
- codex: /usr/local/bin/codex (wrapper) -> /usr/local/bin/.codex-bin (real)
- gemini: /usr/local/bin/gemini (wrapper) -> node .../dist/index.js
- qwen: /usr/local/bin/qwen (wrapper) -> node .../dist/index.js

Works immediately in ANY shell, no manual `source` needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:51:56 +00:00
delta-cloud-208e
77cde5d012 fix(codex): rewrite install script as self-contained for curl pipe usage
- Script no longer depends on local update-codex.sh or SCRIPT_DIR files
- Downloads Codex binary directly from GitHub releases
- Downloads patcher + config from gitea repo
- Sets env vars system-wide (/etc/environment + /etc/profile.d/)
- Proper error handling with set -euo pipefail

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:40:39 +00:00
delta-cloud-208e
b7c72793fe fix(codex): system-wide env vars via /etc/environment + /etc/profile.d/
- Write OPENAI_API_KEY and OPENAI_BASE_URL to /etc/environment (all users)
- Create /etc/profile.d/codex-env.sh for login shell export (all users)
- Export for current session too
- Removes per-user ~/.bashrc approach — system-wide is more reliable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:33:46 +00:00
delta-cloud-208e
3b81f61192 fix(codex): set OPENAI_API_KEY in shell profile + current session
Install/update scripts now:
- Export env vars for current session (fixes "Missing OPENAI_API_KEY")
- Write to ~/.bashrc or ~/.zshrc for persistence
- Handle sudo (detect real user via SUDO_USER)
- Remove stale entries before writing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:32:20 +00:00
delta-cloud-208e
491b2a6854 feat(codex): add Codex CLI patcher — config+env based patching
Codex CLI is a Rust binary — patched via config.toml + env vars.
6 targets: api_endpoint, auth, telemetry, permissions, model, env.
Includes installer, binary updater, config validator, pipeline CLI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:30:57 +00:00