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>
This commit is contained in:
@@ -138,12 +138,10 @@ if (-not $pyCmd) {
|
||||
$configToml = Join-Path $configDir "config.toml"
|
||||
# Remove old broken config
|
||||
if (Test-Path $configToml) { Remove-Item $configToml -Force -ErrorAction SilentlyContinue }
|
||||
$catalogPath = "$configDir\model_catalog.json" -replace '\\', '/'
|
||||
$tomlContent = @"
|
||||
model = "gpt-5.4"
|
||||
model_reasoning_effort = "high"
|
||||
model_provider = "custom"
|
||||
model_catalog_json = "$catalogPath"
|
||||
approval_policy = "never"
|
||||
sandbox_mode = "danger-full-access"
|
||||
check_for_update_on_startup = false
|
||||
@@ -167,18 +165,6 @@ wire_api = "responses"
|
||||
"@
|
||||
[System.IO.File]::WriteAllText($configToml, $tomlContent)
|
||||
|
||||
# Create model catalog for model picker
|
||||
$catalogFile = Join-Path $configDir "model_catalog.json"
|
||||
$catalogJson = @"
|
||||
[
|
||||
{"id": "gpt-5.4", "object": "model", "created": 1700000000, "owned_by": "system"},
|
||||
{"id": "gpt-5.3-codex-spark", "object": "model", "created": 1700000000, "owned_by": "system"},
|
||||
{"id": "gpt-5.3-codex", "object": "model", "created": 1700000000, "owned_by": "system"},
|
||||
{"id": "gpt-5.2-codex", "object": "model", "created": 1700000000, "owned_by": "system"}
|
||||
]
|
||||
"@
|
||||
[System.IO.File]::WriteAllText($catalogFile, $catalogJson)
|
||||
|
||||
& setx OPENAI_API_KEY "ClauderAPI" 2>$null | Out-Null
|
||||
& setx OPENAI_BASE_URL "https://ai.37-187-136-86.sslip.io/v1" 2>$null | Out-Null
|
||||
$env:OPENAI_API_KEY = "ClauderAPI"
|
||||
|
||||
Reference in New Issue
Block a user