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>
This commit is contained in:
delta-cloud-208e
2026-03-08 08:31:56 +00:00
parent e4da4bdbb0
commit aa2cec7647
2 changed files with 24 additions and 8 deletions

View File

@@ -132,9 +132,12 @@ if ($pyCmd) {
if (-not $pyCmd) {
Write-Host " Applying patches (PowerShell)..." -ForegroundColor Cyan
$configDir = "$env:APPDATA\codex"
# Codex reads config from ~/.codex/ (NOT %APPDATA%\codex\)
$configDir = "$env:USERPROFILE\.codex"
New-Item -ItemType Directory -Force -Path $configDir | Out-Null
$configToml = Join-Path $configDir "config.toml"
# Remove old broken config
if (Test-Path $configToml) { Remove-Item $configToml -Force -ErrorAction SilentlyContinue }
$tomlContent = @"
model = "gpt-5.4"
model_reasoning_effort = "high"