{"record":{"id":"c65156e791bfa1de","repo":"openai/codex","slug":"legacy-profile-profile-config-is-no-longer","errorCode":null,"errorMessage":"legacy `profile = \"{profile}\"` config is no longer supported; use `--profile {profile}` with `{profile}.config.toml` instead","messagePattern":"legacy `profile = \"(.+?)\"` config is no longer supported; use `--profile (.+?)` with `(.+?)\\.config\\.toml` instead","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/config/mod.rs","lineNumber":3258,"sourceCode":"            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                \"`sandbox_mode` and `permission_profile` overrides cannot both be set\",\n            ));\n        }\n        if sandbox_mode.is_some() && default_permissions_override.is_some() {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                \"`sandbox_mode` and `default_permissions` overrides cannot both be set\",\n            ));\n        }\n        if permission_profile.is_some() && default_permissions_override.is_some() {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidInput,\n                \"`permission_profile` and `default_permissions` overrides cannot both be set\",\n            ));\n        }\n        if let Some(profile) = cfg.profile.as_deref() {\n            return Err(std::io::Error::new(\n                std::io::ErrorKind::InvalidData,\n                format!(\n                    \"legacy `profile = \\\"{profile}\\\"` config is no longer supported; use `--profile {profile}` with `{profile}.config.toml` instead\"\n                ),\n            ));\n        }\n\n        let tool_suggest = resolve_tool_suggest_config(&cfg, &config_layer_stack);\n        let feature_overrides = FeatureOverrides {\n            web_search_request: override_tools_web_search_request,\n        };\n\n        let configured_features = Features::from_sources(\n            FeatureConfigSource {\n                features: cfg.features.as_ref(),\n                experimental_use_unified_exec_tool: cfg.experimental_use_unified_exec_tool,\n            },\n            FeatureConfigSource {","sourceCodeStart":3240,"sourceCodeEnd":3276,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/config/mod.rs#L3240-L3276","documentation":"Codex removed the top-level `profile` key from config.toml. During Config construction, any `profile = \"<name>\"` found in the merged ConfigToml layers (user config.toml, project .codex/config.toml, or managed layers) aborts loading with an io::Error of kind InvalidData. The message names the profile and points at the replacement: run with `--profile <name>` and keep that profile's overrides in `<name>.config.toml`.","triggerScenarios":"Any config load (codex TUI start, `codex exec`, app-server startup) while some loaded layer contains `profile = \"work\"`. The check runs early, right after the sandbox_mode / permission_profile / default_permissions mutual-exclusion checks and before features or permissions are resolved.","commonSituations":"Upgrading codex-rs past the release that removed the key; a stale ~/.codex/config.toml or project .codex/config.toml written by an older version; dotfile repos and team config templates that still ship a `profile` line; CI scripts generating configs from the old schema.","solutions":["Delete the `profile = \"...\"` line from every config.toml Codex loads (~/.codex/config.toml, project .codex/config.toml, managed layers).","Start Codex with the flag instead: `codex --profile work`.","Move that profile's overrides into `~/.codex/work.config.toml` so `--profile work` applies them.","If the error persists, another layer still defines `profile`; grep every config root again."],"exampleFix":"# ~/.codex/config.toml - before\nprofile = \"work\"\nmodel = \"gpt-5\"\n\n# after - shared settings only\nmodel = \"gpt-5\"\n\n# ~/.codex/work.config.toml - the profile's overrides\nmodel = \"gpt-5-mini\"\n\n# launch with\ncodex --profile work","handlingStrategy":"validation","validationCode":"# Pre-flight: reject configs that still carry the removed key\ngrep -n '^profile' ~/.codex/config.toml .codex/config.toml 2>/dev/null && echo 'remove the legacy profile key; use --profile instead'","typeGuard":null,"tryCatchPattern":"match config_result {\n    Err(ref e) if e.kind() == std::io::ErrorKind::InvalidData\n        && e.to_string().contains(\"legacy `profile`\") => {\n        // strip the key or switch to --profile, then retry once\n    }\n    other => other,\n}","preventionTips":["Run codex with `--profile <name>` instead of persisting a profile key","After upgrading codex-rs, re-validate config.toml against the generated config.schema.json","Keep profile-specific overrides in <profile>.config.toml files","grep shared config templates for removed keys before distributing them"],"tags":["codex","config","toml","migration","profile"],"backgroundTag":"legacy-config-key-removed","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}