{"record":{"id":"aed6d9e511a8eb32","repo":"affaan-m/ECC","slug":"unknown-agent-profile-name","errorCode":null,"errorMessage":"Unknown agent profile: {name}","messagePattern":"Unknown agent profile: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"ecc2/src/config/mod.rs","lineNumber":479,"sourceCode":"            task_group,\n            steps,\n        })\n    }\n\n    fn resolve_agent_profile_inner(\n        &self,\n        name: &str,\n        chain: &mut Vec<String>,\n    ) -> Result<ResolvedAgentProfile> {\n        if chain.iter().any(|existing| existing == name) {\n            chain.push(name.to_string());\n            anyhow::bail!(\"agent profile inheritance cycle: {}\", chain.join(\" -> \"));\n        }\n\n        let profile = self\n            .agent_profiles\n            .get(name)\n            .ok_or_else(|| anyhow::anyhow!(\"Unknown agent profile: {name}\"))?;\n\n        chain.push(name.to_string());\n        let mut resolved = if let Some(parent) = profile.inherits.as_deref() {\n            self.resolve_agent_profile_inner(parent, chain)?\n        } else {\n            ResolvedAgentProfile::default()\n        };\n        chain.pop();\n\n        resolved.apply(name, profile);\n        Ok(resolved)\n    }\n\n    pub fn load() -> Result<Self> {\n        let global_paths = Self::global_config_paths();\n        let project_paths = std::env::current_dir()\n            .ok()\n            .map(|cwd| Self::project_config_paths_from(&cwd))","sourceCodeStart":461,"sourceCodeEnd":497,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/ecc2/src/config/mod.rs#L461-L497","documentation":"ecc2 resolves named agent profiles from configuration by looking them up in the `agent_profiles` map. When the requested profile name is not defined in config, it returns this error instead of silently falling back. The error is raised inside recursive profile resolution, so it also fires when an `inherits` parent name points to a profile that does not exist.","triggerScenarios":"Calling any command that resolves an agent profile by name (e.g. `resolve_agent_profile(name)`) where `name` is absent from `cfg.agent_profiles`, or where a profile's `inherits` field names a nonexistent parent profile.","commonSituations":"Typos in a profile name on the CLI or in a config file; renaming or deleting a profile in ecc2 config while other profiles still inherit from it; copying a config from another machine that defined a custom profile; referencing a built-in profile name that has been removed.","solutions":["Run the config/profile listing command (or inspect the config file) to see the exact defined profile names and correct the typo in the name argument.","Add the missing profile definition under `agent_profiles` in the ecc2 config file.","If the error mentions a parent chain, check each profile's `inherits` field and point it at an existing profile or remove the inherits line.","If the profile was defined in a project-local config, run from the project directory or pass the config path explicitly."],"exampleFix":"// before (config.toml)\n[agent_profiles.reviewer]\ninherits = \"senior-reviewer\"  # parent not defined -> \"Unknown agent profile: senior-reviewer\"\n\n// after\n[agent_profiles.senior-reviewer]\nprompt = \"You are a senior reviewer...\"\n\n[agent_profiles.reviewer]\ninherits = \"senior-reviewer\"","handlingStrategy":"validation","validationCode":"// shell: verify the profile exists before invoking\necc2 config show | grep -q \"^\\[agent_profiles.$NAME\\]\" || { echo \"profile '$NAME' not defined\"; exit 1; }","typeGuard":"fn profile_exists(cfg: &Config, name: &str) -> bool {\n    cfg.agent_profiles.contains_key(name)\n}","tryCatchPattern":null,"preventionTips":["Keep a canonical list of profile names in project docs and reference it in scripts.","Prefer completing names from `ecc2 config show` instead of typing them from memory.","When renaming a profile, grep all `inherits = \"...\"` lines and update parents in the same commit.","Centralize profile definitions in one config file to avoid per-machine drift."],"tags":["config","agent-profiles","rust","cli"],"backgroundTag":"invalid-config-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}