{"record":{"id":"648176308eec274a","repo":"BigPizzaV3/CodexPlusPlus","slug":"codex-model-catalog-json","errorCode":null,"errorMessage":"当前 Codex 配置使用外部 model_catalog_json，无法同时应用每模型窗口、自动压缩或元数据","messagePattern":"当前 Codex 配置使用外部 model_catalog_json，无法同时应用每模型窗口、自动压缩或元数据","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/relay_config.rs","lineNumber":2035,"sourceCode":"                        &existing,\n                        &catalog_relative,\n                        &entries,\n                        fallback,\n                    )?\n                {\n                    let mut doc = parse_toml_document(&config_text)?;\n                    doc[\"model_catalog_json\"] = toml_edit::value(catalog_relative);\n                    return Ok(normalize_optional_toml(doc));\n                }\n                return Ok(config_text);\n            }\n        }\n    }\n    if !official_deepseek_responses\n        && let Some(external_catalog) = live_external_model_catalog(home)\n    {\n        if has_per_model_overrides {\n            anyhow::bail!(\n                \"当前 Codex 配置使用外部 model_catalog_json，无法同时应用每模型窗口、自动压缩或元数据\"\n            );\n        }\n        let mut doc = parse_toml_document(&config_text)?;\n        if custom_responses\n            && copy_standard_responses_catalog(\n                home,\n                &external_catalog,\n                &catalog_relative,\n                &entries,\n                fallback,\n            )?\n        {\n            doc[\"model_catalog_json\"] = toml_edit::value(catalog_relative);\n        } else {\n            doc[\"model_catalog_json\"] = toml_edit::value(external_catalog);\n        }\n        return Ok(normalize_optional_toml(doc));","sourceCodeStart":2017,"sourceCodeEnd":2053,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/relay_config.rs#L2017-L2053","documentation":"Same conflict as the in-config case but detected against the live home directory: if the Codex config references an external model catalog on disk (live_external_model_catalog) and per-model overrides are requested, the apply bails. The wording '当前 Codex 配置' distinguishes it from error 307, which fires on the pointer found inside the config text itself.","triggerScenarios":"Calling the apply pipeline with has_per_model_overrides == true while live_external_model_catalog(home) finds an external catalog (e.g. ~/.codex/codex-models.json referenced by config), and not in the official-deepseek-responses fast path.","commonSituations":"An external catalog file created by an earlier run or another tool still lives in ~/.codex; user applies per-model windows without realizing the external catalog pointer is still active.","solutions":["Delete or de-register the external catalog pointer (remove model_catalog_json from config.toml and/or the catalog file reference), then re-apply","Or apply without per-model window/auto-compact/metadata overrides","Fold the external catalog's model entries into model_windows and regenerate a managed catalog"],"exampleFix":"// before\n$ rm not needed; instead config.toml still points to codex-models.json\nmodel_catalog_json = \"/home/user/.codex/codex-models.json\"\n// after\n# remove the pointer, then run apply with model_windows\ncodex-plus apply --profile my-profile --model-windows deepseek-v4-pro=1M\n","handlingStrategy":"validation","validationCode":"if !official_deepseek_responses && live_external_model_catalog(home).is_some() && has_per_model_overrides {\n    return Err(anyhow::anyhow!(\"外部 catalog 与每模型覆盖冲突\"));\n}","typeGuard":null,"tryCatchPattern":"match apply_relay_profile_to_home_with_switch_rules(...) {\n    Err(e) if e.to_string().contains(\"外部 model_catalog_json\") => offer_migrate_external_catalog_to_model_windows(),\n    other => other?,\n}","preventionTips":["Check ~/.codex for stale external catalog files before apply","Migrate external catalog entries into model_windows once, then delete the pointer","Log/detect when another tool writes model_catalog_json"],"tags":["config","conflict","catalog","filesystem"],"backgroundTag":"conflicting-config-options","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}