60 Commits

Author SHA1 Message Date
delta-cloud-208e
dd11b9784d fix(uninstall): MANDATORY tar backup in ALL modes (safe/settings-only/full)
Per user demand after data loss incident: never trust mode flags alone.
Previously only `full` mode created tar.gz backup. Now `safe` and
`settings-only` also create full tar.gz of ~/.claude (resp .codex,
.gemini, .qwen) BEFORE any mutation. If backup fails, refuse to
proceed for that user — skip to next.

Restore is always one command:
  tar -xzf ~/.<tool>.uninstall-backup.<TS>.tar.gz -C ~

Applies to all 4 scripts: uclaude, ucodex, ugemini, uqwen.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 07:17:34 +00:00
delta-cloud-208e
84c1287501 feat(uninstall): interactive 3-mode prompt + safe-by-default — claude/codex/gemini/qwen
After user lost 6 months of work to `rm -rf ~/.claude`, ALL 4 uninstall
scripts (claude, codex, gemini, qwen) now require explicit choice:

Modes:
  1) safe (default)    — remove binary + env + settings.json
                          KEEP projects, history, commands(skills),
                          plans, file-history, plugins
  2) settings-only     — clear settings.json only, keep binary + data
  3) full              — wipe everything (tar backup first, requires
                          typing 'WIPE' to confirm)
  4) cancel            — exit, do nothing

Default flow:
- Interactive prompt with PREVIEW of user data (size, project count,
  command count, history line count) before any destructive op
- Cancel option always available
- Each file backed up to *.uninstall.bak.<TS> before removal
- /etc/environment + .bashrc + /etc/profile.d backed up before sed

Non-interactive (CI / scripts):
  UCLAUDE_MODE=safe sudo bash uclaude_uninstall.sh
  UCLAUDE_MODE=full sudo bash uclaude_uninstall.sh   # creates tar backup
  UCLAUDE_YES=1     # skip prompt, default to safe mode

NEVER again should an uninstaller silently destroy user data.

Per-tool env vars: UCLAUDE_MODE / UCODEX_MODE / UGEMINI_MODE / UQWEN_MODE.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 07:02:15 +00:00
delta-cloud-208e
47e1978bef fix(installer): retry git ops + reject placeholder api_key + sync public configs
User hit two bugs in production:
1. uclaude_install.sh ERROR: Command failed at line 82 — gitea returned
   transient HTTP 502 to `git fetch`, `2>/dev/null` masked stderr but
   ERR trap fired with cryptic message.
2. After install, claude model picker showed only 5 models (built-in
   defaults) instead of 19. Root cause: load_config() fell back to the
   PUBLIC sanitized patcher.config.json (api_key='YOUR_API_KEY') after
   remote fetch failed → claude API auth broken → custom models invisible.

Fixes:

claude/uclaude_install.sh:
- New retry_git() helper: 3 attempts, 5s backoff, loud diagnostic
- Existing-clone branch: retry_git wraps `git fetch` AND `git reset`
- Fallback: if fetch fails 3x on existing clone, nuke and re-clone fresh
  (incremental fetch breaks more often than full clone on flaky gitea)
- Secondary fetch (before updater): tolerates failure with `|| true`
  (we already have a working clone)

claude/uclaude_updater.py:
- _config_is_usable() guard: rejects {"api_key": "YOUR_API_KEY"} etc.
- load_config() retries remote 3x with backoff before falling back
- Removed local-file fallback (was loading public sanitized = bait)
- Cache-only fallback now (from previous successful fetch)

Public configs synced from canonical (api_key sanitized, models list
fully refreshed):
- claude/patcher.config.json: 17 → 19 models (+gpt-5.5, +gemini-3.1-pro etc)
- codex/codex_config.json: 4 → 5 models (+gpt-5.5)
- gemini/gemini_config.json: refreshed
- target_version: 2.1.112 → 2.1.119

Tests: tests/test_installer_robustness.py — 6 new GREEN guards.
Total: 196 → 207 GREEN.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 18:25:43 +00:00
delta-cloud-208e
134606839a fix(uninstall): wildcard env cleanup + AUTH_TOKEN + npm + claude README (Item 18)
User asked: do per-tool READMEs document uninstall? Sub-agent audit
(gpt-5.5 sh + glm-5.1 ps1) found multiple BLOCKERs in uninstall scripts.

Fixes:

1. claude/README.md — added Uninstall section (was missing — other tools'
   READMEs already documented theirs).

2. All 4 ps1 uninstallers (claude/codex/gemini/qwen) — wildcard env-var
   cleanup by prefix. Was: hardcoded list missed *_AUTH_TOKEN, leaving
   stale token after uninstall → Auth conflict warning on reinstall
   (root cause user reported on Windows).
   Prefixes:
     claude → ANTHROPIC_*, CLAUDE_*, DISABLE_TELEMETRY, ...
     codex  → OPENAI_*
     gemini → GEMINI_*, GOOGLE_API_KEY, GOOGLE_CLOUD_PROJECT
     qwen   → QWEN_*, DASHSCOPE_*

3. codex/ucodex_uninstall.ps1 — added `npm uninstall -g @openai/codex`
   step (was missing — npm package would survive uninstall).

4. codex/ucodex_uninstall.ps1 — also clears npm registry override
   `@openai:registry`.

Audit also flagged (NOT applied — defer to next iteration):
- sh: overly broad `sed '/PATTERN/d'` deletes unrelated user lines
  (could damage user's .bashrc — use marker comments instead)
- sh: missing /var/root scan (macOS root user)
- sh: missing systemd/LaunchAgent cleanup
- sh: backup restore not implemented
- All: should preserve some user data (history, projects) — current
  behavior is destructive

Tests: tests/test_uninstall_completeness.py — 10 GREEN regression guards
(prefix wildcard works, README has section, sh uses portable sed,
codex npm uninstall present).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 18:03:41 +00:00
delta-cloud-208e
06057f864b fix(installers): 8 critical bugs from gpt-5.5 + glm-5.1 audit (Item 17)
Sub-agents reviewed all 26 installer scripts. Fixed (TDD):

BLOCKERS (install fails on platform):
1. claude/uclaude_uninstall.sh: replace `sed -i` → portable `sedi()` helper
   (BSD sed on macOS requires `-i ''`, GNU uses `-i`). Same fix style as
   codex/ucodex_install.sh:sedi.
2. claude/uclaude_install.ps1: abort if $apiKey null after fetch attempt
   (was silently completing install with broken auth env vars). Guard
   added to all 8 ps1 scripts.
3. qwen/uqwen_install.ps1 + uqwen_update.ps1: build trustedFolders.json
   via [ordered]@{} | ConvertTo-Json (PowerShell single-quoted literal
   was preserving `\"` as backslash+quote, producing INVALID JSON).
4. codex/ucodex_update.ps1: check $LASTEXITCODE after Python patcher call
   (native command non-zero exit doesn't throw under
   ErrorActionPreference='Continue' — patcher failure was silent, no
   PowerShell fallback triggered).

HIGH (wrong behavior / regressions):
5. gemini/ugemini_install.ps1 + update.ps1: read $env:UGEMINI_API_KEY
   FIRST (was only checking $env:UCLAUDE_API_KEY — claude variable).
6. gemini/ugemini_update.ps1: download gemini_config.json from PRIVATE
   unlimitedcoding-config (was downloading from public — would 404 after
   Item 14 sanitization).
7. claude/uclaude_update.ps1: drop ANTHROPIC_API_KEY assignment + dynamic
   models fetch (regression — install.ps1 was fixed earlier but update.ps1
   still set both env vars, re-introducing Auth conflict warning).
8. codex/ucodex_install.sh + update.sh: GitHub API curl needs
   `-H "User-Agent: UnlimitedCoding-Installer"` and `-f` flag (default
   curl/X.Y UA gets 403 from GitHub API + silent fail on 5xx).

Bonus fixes pulled in:
- codex/ucodex_install.ps1: switch codex_config download URL to private
  repo (consistency with update.ps1 + Item 14 sanitization)
- codex/ucodex_install.ps1: add `--all` flag to patcher invocation
  (matched between install + update)

Tests: tests/test_installer_bugs_audit.py — 9 GREEN regression guards.
Total: 186 tests GREEN.

Audit transcripts: gpt-5.5 found 24 issues (claude+gemini), glm-5.1
found 11 issues (codex+qwen). Lower-priority items (heredoc unsafe
quoting, lock files, schema validation) deferred to next iteration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 17:16:43 +00:00
delta-cloud-208e
34868eea72 fix(codex): sync codex_patcher.py with TOML inline-table fix
Mirrors claude_code_patcher@661eced — fixes Windows ucodex_install.ps1
crash 'Error loading config.toml: missing assignment' caused by
toml_value(dict) emitting Python str(dict) instead of TOML syntax.

Existing broken installs: re-run installer or manually delete the bad
section from ~/.codex/config.toml then re-run ucodex_install.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 16:53:52 +00:00
delta-cloud-208e
31f9c3e1a8 refactor(installers): extract PRIVATE_CONFIG_BASE in sh scripts (DRY) 2026-04-25 16:43:59 +00:00
delta-cloud-208e
8924b75e91 SECURITY: redact api_key from public repo (Variant B)
CRITICAL: api_key 'ClauderAPI2' was committed to PUBLIC unlimitedcoding
repo (private:False on gitea) in 4 *_config.json + 8 ps1 scripts. Anyone
on the internet could read it via curl with no auth (HTTP 200 raw access).

This commit:
1. Sanitizes 4 *_config.json: api_key → "YOUR_API_KEY" + _note pointing
   users to private config repo for production credentials.
2. Removes 'ClauderAPI2' literal from 8 ps1 installer/updater scripts
   (claude/codex/gemini/qwen × install/update). Each script now has a
   sanitized block at top that fetches api_key from private
   unlimitedcoding-config repo at runtime via Authorization token.
3. Switches 6 sh installer scripts from public REPO_RAW to PRIVATE
   unlimitedcoding-config base URL for *_config.json downloads.
4. Removes stale .patcher.config.cache.json (will regen on next install).

Production configs MOVED to private repo (separate commit e839102 on
unlimitedcoding-config/main).

KNOWN UNCHANGED:
- releases/v2.1.119/sea/cli-wrapper.cjs still has api_key (part of npm
  package distribution; clients need it locally; sensey serves same).
- Read-only gitea token (cadffcb0...) remains in installers — needed
  for token-auth fetch from private repo. Scoped read-only.

RECOMMEND: api_key rotation in proxy auth list because ClauderAPI2 was
publicly exposed for an unknown period. Existing client installs would
need re-install or env override.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 16:43:08 +00:00
delta-cloud-208e
b97ac4bb9e feat(codex): auto-update to v0.125.0
Binary: 0.124.0 -> 0.125.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-25 04:06:37 +00:00
delta-cloud-208e
65bc1b4bee feat(codex): auto-update to v0.124.0
Binary: 0.123.0 -> 0.124.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-23 19:38:16 +00:00
delta-cloud-208e
889d3af956 feat(codex): auto-update to v0.123.0
Binary: 0.122.0 -> 0.123.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-23 04:06:32 +00:00
delta-cloud-208e
3381797148 fix(ps1): strip all non-ASCII Unicode from PowerShell scripts
Windows PowerShell 5.1 reads .ps1 files without BOM as Windows-1251 by
default. Em-dashes (-) and other Unicode chars in string literals get
mangled into invalid bytes (e.g. "session - no" becomes garbage that
breaks the parser with "Unexpected token" errors.

Replaced em-dash, en-dash, smart quotes, ellipsis, NBSP and arrows with
their ASCII equivalents across all 12 .ps1 scripts (install/update/
uninstall for claude/gemini/codex/qwen).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 10:53:15 +00:00
delta-cloud-208e
82830c971d fix(qwen): patch regional dashscope endpoints + inline validator
Qwen patcher had two issues:
1. Only patched dashscope.aliyuncs.com but missed regional endpoints
   (cn-hongkong, dashscope-intl, dashscope-us). Users in those regions
   would still hit Aliyun directly.
2. --validate raised ModuleNotFoundError (referenced removed updater/
   package). Replaced with self-contained inline checker — 13 GREEN
   targets covering cli.js markers, settings.json, env vars.

Also bump Codex version to v0.122.0 across all READMEs (was v0.116.0).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 10:26:55 +00:00
delta-cloud-208e
f7cf0b79fd docs: cross-platform install/update/uninstall instructions for codex/gemini/qwen
- Add Linux / macOS / Windows PowerShell / Windows CMD sections to all CLI READMEs
- Update product table versions (claude v2.1.112, codex v0.116.0, qwen v0.14.5)
- Make qwen install/update/uninstall scripts macOS-aware (sedi wrapper, launchctl, /Users scan, ~/.zshrc)
- Make gemini uninstall script macOS-aware (matching install/update)
- Fix CRLF line endings in qwen/gemini uninstall scripts

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-21 09:30:16 +00:00
delta-cloud-208e
1320f13f5c feat(codex): auto-update to v0.122.0
Binary: 0.121.0 -> 0.122.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 02:06:17 +00:00
delta-cloud-208e
99d55d3ab2 feat(codex): auto-update to v0.121.0
Binary: 0.120.0 -> 0.121.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 02:08:28 +00:00
delta-cloud-208e
fd359755ec feat(codex): auto-update to v0.120.0
Binary: 0.119.0 -> 0.120.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 14:08:02 +00:00
delta-cloud-208e
7d75fabcd2 feat(codex): auto-update to v0.119.0
Binary: 0.118.0 -> 0.119.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 02:09:02 +00:00
delta-cloud-208e
aedec5606d feat(codex): auto-update to v0.118.0
Binary: 0.117.0 -> 0.118.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-01 02:08:41 +00:00
delta-cloud-208e
3b293c1332 feat(codex): auto-update to v0.117.0
Binary: 0.116.0 -> 0.117.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 02:00:15 +00:00
delta-cloud-208e
65c2671f9d chore: replace API key ClauderAPI → ClauderAPI2
Updated in all config files, installer/updater scripts across
claude/gemini/codex/qwen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 06:52:31 +00:00
delta-cloud-208e
ef964c6442 fix: Windows installer missing CLAUDE_CUSTOM_MODELS and other env vars
PS1 installer/updater only set ANTHROPIC_API_KEY and ANTHROPIC_BASE_URL,
missing CLAUDE_CUSTOM_MODELS (required for model picker), AUTH_TOKEN,
default model vars, and telemetry disable vars.

Also added .claude.json pre-configuration (onboarding skip, dark theme)
and mcp__* permission to settings.json.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 08:46:52 +00:00
delta-cloud-208e
de5c9334db feat(codex): auto-update to v0.116.0
Binary: 0.115.0 -> 0.116.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 02:09:12 +00:00
delta-cloud-208e
72cb50a166 feat(codex): auto-update to v0.115.0
Binary: 0.114.0 -> 0.115.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 02:02:39 +00:00
delta-cloud-208e
5525f6009a chore: change codex default reasoning effort from high to xhigh
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 22:39:55 +00:00
delta-cloud-208e
073cb7b18d feat(codex): auto-update to v0.114.0
Binary: 0.111.0 -> 0.114.0
Config synced from claude_code_patcher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:11:36 +00:00
delta-cloud-208e
df264a42ed fix(codex): remove unused import stat
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 11:57:18 +00:00
delta-cloud-208e
acd21cbcf0 fix(codex): model_catalog_json pointed to /var/root for all users
Root cause: generate_config_toml() used os.path.expanduser("~") which
always returns root's home under sudo. Every user's config.toml had
model_catalog_json = "/var/root/.codex/model_catalog.json" → Permission denied.

Fix: pass home_dir to generate_config_toml() so each user gets their own path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:38:00 +00:00
delta-cloud-208e
c8c56b58b7 fix(codex): force chown+chmod on all user .codex dirs after install
Previous chown was unreliable — stat-based owner detection, missing
chmod, SUDO_USER edge cases. Now: simple loop over /Users/* (macOS)
or /home/* (Linux), chown -R + chmod -R u+rwX for each.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:34:22 +00:00
delta-cloud-208e
2a585ec758 fix(codex): clean broken config.toml before patching + fix macOS user discovery
- Delete config.toml with double-quoted keys bug before regenerating
- Replace pwd.getpwall() with /Users/* scan on macOS (Directory Services unreliable)
- Proper chown via stat of home directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:31:13 +00:00
delta-cloud-208e
1f827cc9d8 fix(codex): replace pwd.getpwall() with directory scan for macOS
macOS Directory Services makes pwd.getpwall() unreliable — regular users
may not be returned. Now scans /Users/* directly on macOS, /home/* on Linux.
Also fixes chown to use actual directory ownership.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:28:10 +00:00
delta-cloud-208e
b27c0cd65e fix(codex): fix permission denied for non-root users
- chown -R ~/.codex/ to actual user after patching (sudo creates as root)
- Detect SUDO_USER for the invoking user
- Iterate /Users/*/.codex (macOS) and /home/*/.codex (Linux) to fix all

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 18:24:07 +00:00
delta-cloud-208e
495ce916b3 fix(codex): fix TOML parser double-quoting section keys + add macOS trust paths
- Minimal TOML parser (Python < 3.11 fallback) now strips quotes from section
  keys like [projects."/home"] — prevents double-quoting on re-parse
- Add /Users and /var/root to trust_paths on macOS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:58:17 +00:00
delta-cloud-208e
ab6be896bd fix(codex): patch all users, not just root — add --all flag and fix macOS UID threshold
- Install script now runs patcher with --all to patch every user's ~/.codex/config.toml
- Fix list_users() UID threshold: macOS starts at 500, Linux at 1000
- Fix file ownership: chown config files to the actual user after patching

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:54:43 +00:00
delta-cloud-208e
128ec80ed0 fix(codex): macOS compatibility for install/update/uninstall scripts
- Replace grep -oP (Perl regex) with portable sed — fixes "grep: invalid option -- P" on macOS
- Add sedi() wrapper for cross-platform sed -i (BSD vs GNU)
- Detect macOS via uname and use apple-darwin binary suffix instead of linux-musl
- Add is_native_binary() helper: checks both ELF (Linux) and Mach-O (macOS)
- macOS env vars: use launchctl setenv + /etc/codex-env.sh + ~/.zshrc source line
- Linux env vars: keep /etc/environment + /etc/profile.d/ as before
- Wrapper script uses dynamic ENV_FILE path instead of hardcoded /etc/profile.d/
- Fix SUDO_USER handling for correct ~/.zshrc path when run via sudo
- Uninstaller: also remove .codex-bin, /etc/codex-env.sh, launchctl vars, rc file entries
- Uninstaller: scan /Users/* on macOS instead of /home/*
- Fix CRLF line endings in ucodex_uninstall.sh

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 17:45:41 +00:00
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
be048ee873 fix: audit fixes across all install/update scripts
- codex/ucodex_update.sh: fix ${NC} → ${RESET} (crashed with set -u), fix CRLF
- gemini/ugemini_install.sh: read API_KEY/BASE_URL from config instead of hardcoded, fix "source ~/.bashrc" → "source /etc/profile.d/gemini-cli.sh"
- qwen/uqwen_install.sh: read API_KEY/BASE_URL from config instead of hardcoded

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 10:43:06 +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
4734cead32 feat(codex): add gpt-5.3 to model catalog and config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 09:02:20 +00:00
delta-cloud-208e
0e5564732b fix(codex): model_catalog_json with correct Codex internal format
Previous attempt used OpenAI API format (bare array of {id, object}).
Codex expects ModelsResponse format: {"models": [{slug, display_name,
visibility, shell_type, supported_reasoning_levels, ...}]}.

Format reverse-engineered from codex-rs/core/models.json in official repo.
All 4 models (gpt-5.4, gpt-5.3-codex-spark, gpt-5.3-codex, gpt-5.2-codex)
now appear in interactive model picker.

Cleanup logic detects old bare-array format and replaces automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:58:33 +00:00
delta-cloud-208e
60703fc7db fix(codex): auto-cleanup broken model_catalog_json on install/update
All scripts now detect and fix leftover damage from previous installs:
- Remove model_catalog_json from config.toml (crashes Codex on startup)
- Delete stale model_catalog.json file
- Detect broken TOML with dotted key bug
Both PS1 scripts and Python patcher handle cleanup before patching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:50:33 +00:00
delta-cloud-208e
fa07058917 fix(codex): remove model_catalog_json — wrong format crashed Codex
model_catalog_json expects internal Codex ModelsResponse format with
complex ModelInfo structs (slug, display_name, visibility, shell_type,
supported_reasoning_levels, etc.), not simple OpenAI API format.
Removed from all configs to restore working state.

env_key = "OPENAI_API_KEY" fix is preserved (fixes 401 Unauthorized).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:48:31 +00:00
delta-cloud-208e
416720ae51 fix(codex): add env_key to custom provider + model_catalog_json for picker
- Add env_key = "OPENAI_API_KEY" to [model_providers.custom] in PS1 fallback
  templates (fixes 401 Unauthorized on machines without Python 3.11+)
- Add model_catalog_json config + model_catalog.json file generation
  (fixes empty model picker — all 4 models now visible in interactive mode)
- Both fixes applied in: codex_patcher.py, ucodex_install.ps1, ucodex_update.ps1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:43:25 +00:00
delta-cloud-208e
aa2cec7647 fix(codex): write config to ~/.codex/ not %APPDATA%\codex\
Codex CLI reads config from %USERPROFILE%\.codex\config.toml
but PowerShell fallback was writing to %APPDATA%\codex\config.toml.
Old broken config remained in ~/.codex/ causing TOML parse errors.

- Fix config path: $env:APPDATA\codex → $env:USERPROFILE\.codex
- Add cleanup step to remove broken config before patching
- Remove old config before writing new one

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:31:56 +00:00
delta-cloud-208e
e4da4bdbb0 fix: TOML dotted key bug + PowerShell fallback for all Windows scripts
- codex: add [notice.model_migrations] with quoted keys to prevent
  Codex from writing unquoted dotted keys (gpt-5.4 → gpt-5 → 4)
  which causes "invalid type: map, expected a string" TOML error
- codex_patcher.py: add toml_key() to quote keys with dots,
  handle broken TOML gracefully in read_toml()
- claude install: remove unnecessary Python requirement
- claude update: rewrite as standalone (no git clone dependency)
- gemini update: add Python check with fallback, auth headers
- qwen install: add PowerShell fallback, auth headers, no exit on no Python
- qwen update: add Python check with fallback, auth headers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:26:52 +00:00
delta-cloud-208e
99c4c0bee6 fix(codex): add PowerShell fallback when Python is missing
On Windows Server without winget/Python, the patcher now generates
config.toml directly in PowerShell instead of requiring Python 3.11+.
Python patcher is still used when available.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 08:18:28 +00:00