{"record":{"id":"aed6d9e511a8eb32","repo":"affaan-m/ECC","slug":"unknown-agent-profile-name","errorCode":null,"errorMessage":"Unknown agent profile: {name}","messagePattern":"Unknown agent profile: (.+?)","errorType":"exception","errorClass":null,"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/01e15490f04e29cfefe3896951f43db46994d8ee/ecc2/src/config/mod.rs#L461-L497","documentation":"Runtime error from Config::resolve_agent_profile_inner in ecc2/src/config/mod.rs. After the cycle check, the method looks up the name in self.agent_profiles; if absent it bails with \"Unknown agent profile: {name}\". The name is exact and case-sensitive, so the cause is a reference (from an orchestration template's `agent`/`profile`, or from another profile's `inherits`) that the loaded config never declared.","triggerScenarios":"Calling resolve_agent_profile(name) (directly or via resolve_orchestration_template) with a `name` not present in the agent_profiles map. Also fires when an `inherits =` points at a profile that does not exist.","commonSituations":"Typo in the profile name; profile was renamed or removed but references were not updated; profile is defined in a config file not on the load path; case mismatch between reference and definition.","solutions":["List the registered agent_profiles and copy the exact key.","Verify every `inherits =` and every template `agent`/`profile` resolves to a defined profile.","Confirm all relevant config files are loaded.","Match casing exactly."],"exampleFix":"# before\n[agent_profiles.reviewer]\ninherits = \"senior\"   # does not exist\n\n# after\n[agent_profiles.reviewer]\ninherits = \"senior_reviewer\"","handlingStrategy":"validation","validationCode":"// Validate every profile reference before resolving.\nlet known: HashSet<&str> = cfg.agent_profile_names().into_iter().collect();\nfor n in refs {\n    if !known.contains(n.as_str()) {\n        anyhow::bail!(\"unknown agent profile {n:?}; known: {:?}\", known);\n    }\n}","typeGuard":"fn profile_exists(cfg: &Config, name: &str) -> bool {\n    cfg.agent_profile(name).is_some()\n}","tryCatchPattern":"match cfg.resolve_agent_profile(name) {\n    Ok(p) => p,\n    Err(e) if e.to_string().contains(\"Unknown agent profile\") => {\n        eprintln!(\"tip: known profiles: {:?}\", cfg.agent_profile_names());\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Copy profile names exactly, including casing.","Lint `inherits`, template `agent`, and template `profile` references at load time.","Rename profiles via a project-wide refactor, not by hand.","Run a config test that resolves every profile."],"tags":["rust","config","validation","inheritance"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}