affaan-m/ECC · error

Unknown agent profile: {name}

Error message

Unknown agent profile: {name}

What it means

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.

Source

Thrown at ecc2/src/config/mod.rs:479

            task_group,
            steps,
        })
    }

    fn resolve_agent_profile_inner(
        &self,
        name: &str,
        chain: &mut Vec<String>,
    ) -> Result<ResolvedAgentProfile> {
        if chain.iter().any(|existing| existing == name) {
            chain.push(name.to_string());
            anyhow::bail!("agent profile inheritance cycle: {}", chain.join(" -> "));
        }

        let profile = self
            .agent_profiles
            .get(name)
            .ok_or_else(|| anyhow::anyhow!("Unknown agent profile: {name}"))?;

        chain.push(name.to_string());
        let mut resolved = if let Some(parent) = profile.inherits.as_deref() {
            self.resolve_agent_profile_inner(parent, chain)?
        } else {
            ResolvedAgentProfile::default()
        };
        chain.pop();

        resolved.apply(name, profile);
        Ok(resolved)
    }

    pub fn load() -> Result<Self> {
        let global_paths = Self::global_config_paths();
        let project_paths = std::env::current_dir()
            .ok()
            .map(|cwd| Self::project_config_paths_from(&cwd))

View on GitHub (pinned to 01e15490f0)

Solutions

  1. List the registered agent_profiles and copy the exact key.
  2. Verify every `inherits =` and every template `agent`/`profile` resolves to a defined profile.
  3. Confirm all relevant config files are loaded.
  4. Match casing exactly.

Example fix

# before
[agent_profiles.reviewer]
inherits = "senior"   # does not exist

# after
[agent_profiles.reviewer]
inherits = "senior_reviewer"
Defensive patterns

Strategy: validation

Validate before calling

// Validate every profile reference before resolving.
let known: HashSet<&str> = cfg.agent_profile_names().into_iter().collect();
for n in refs {
    if !known.contains(n.as_str()) {
        anyhow::bail!("unknown agent profile {n:?}; known: {:?}", known);
    }
}

Type guard

fn profile_exists(cfg: &Config, name: &str) -> bool {
    cfg.agent_profile(name).is_some()
}

Try / catch

match cfg.resolve_agent_profile(name) {
    Ok(p) => p,
    Err(e) if e.to_string().contains("Unknown agent profile") => {
        eprintln!("tip: known profiles: {:?}", cfg.agent_profile_names());
        return Err(e);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13). Data as JSON: /api/errors/aed6d9e511a8eb32. Report an issue: GitHub.