{"record":{"id":"eac20ccf25ef9e12","repo":"xai-org/grok-build","slug":"profile-name-extends-base-name-but-custom","errorCode":null,"errorMessage":"Profile '{name}' extends '{base_name}', but custom profiles cannot extend other custom profiles (only built-ins)","messagePattern":"Profile '(.+?)' extends '(.+?)', but custom profiles cannot extend other custom profiles \\(only built-ins\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-sandbox/src/profiles.rs","lineNumber":490,"sourceCode":"                         [profiles.{name}]\\n\\\n                         extends = \\\"workspace\\\"\\n\\\n                         read_only = [\\\"/data\\\"]\\n\"\n                    )\n                })?;\n\n                // Start from the base profile if `extends` is set\n                let (base, mut profile) = if let Some(base_name) = &profile_config.extends {\n                    let base: ProfileName = base_name.parse().map_err(|e: String| {\n                        anyhow::anyhow!(\"Profile '{name}' extends invalid base: {e}\")\n                    })?;\n                    if matches!(base, Self::Off) {\n                        anyhow::bail!(\n                            \"Profile '{name}' extends '{base_name}', but 'off'/'none' \\\n                             is not a valid base profile\"\n                        );\n                    }\n                    if matches!(base, Self::Custom(_)) {\n                        anyhow::bail!(\n                            \"Profile '{name}' extends '{base_name}', but custom profiles \\\n                             cannot extend other custom profiles (only built-ins)\"\n                        );\n                    }\n                    let resolved = base.resolve(workspace, config)?;\n                    (base, resolved)\n                } else {\n                    (Self::Workspace, Self::Workspace.resolve(workspace, config)?)\n                };\n\n                profile.name = name.clone();\n\n                // Apply overrides from the custom config\n                if let Some(restrict_net) = profile_config.restrict_network {\n                    profile.restrict_network = restrict_net;\n                }\n\n                for path_str in &profile_config.read_only {","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-sandbox/src/profiles.rs#L472-L508","documentation":"This error fires when a custom profile tries to extend another custom profile. Extension is restricted to built-in base profiles so the inheritance chain is at most one level deep and fully deterministic; chaining custom profiles would require recursive resolution the resolver intentionally does not do.","triggerScenarios":"A config profile sets `extends` to the name of another user-defined custom profile (anything that parses to ProfileName::Custom) and resolve is called on it.","commonSituations":"Layering a team-shared custom profile on top of a personal one; generated configs referencing other profiles in the same file; refactoring where a former built-in was replaced by a custom profile of the same name.","solutions":["Change the profile's `extends` to point at a built-in profile instead of another custom profile","Inline the settings from the custom base profile into the extending profile and drop `extends`","Merge the two custom profiles into one, or promote the base to a shared built-in"],"exampleFix":"# before\n[profiles.b]\nextends = \"a\"  # 'a' is a custom profile\n\n# after\n[profiles.b]\nextends = \"minimal\"","handlingStrategy":"validation","validationCode":"fn validate_extends_target(cfg: &ProfileConfig, builtin_names: &[&str]) -> Result<(), String> {\n    if let Some(base) = &cfg.extends {\n        if !builtin_names.contains(&base.as_str()) {\n            return Err(format!(\"profile '{}' must extend a built-in, not '{base}'\", cfg.name));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match ProfileName::resolve(name, &workspace, &config) {\n    Ok(p) => apply(p),\n    Err(e) if e.to_string().contains(\"cannot extend other custom profiles\") => {\n        eprintln!(\"config error: {e}; extend a built-in instead\");\n        std::process::exit(2);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Only extend built-in profile names (keep a whitelist handy)","Flatten custom-on-custom inheritance by inlining the base's settings","Promote widely reused bases into shared built-ins rather than chaining"],"tags":["config","profile","validation"],"backgroundTag":"invalid-profile-base","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}