tinyhumansai/openhuman · error · anyhow::Error

agent registry rejected after merging workspace overrides…

Error message

agent registry rejected after merging workspace overrides from {}: {}

What it means

The agent registry re-validates the spawn-hierarchy (tier) contract after merging workspace agent TOML overrides into the built-in set. A workspace definition (same id as a built-in) replaced a bundled agent but violates that contract — e.g. a subagent tier referencing an unknown/invalid parent or an orchestrator/subagent cycle — so the merged registry is rejected.

Solutions

  1. Fix the tier/subagent declarations in the workspace agent TOML at the logged path so the hierarchy is valid
  2. Remove or rename the workspace override that clashes with the built-in agent id
  3. Compare the workspace file's tier fields against the built-in definition it replaces and align them
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/agent/harness/definition.rs:763 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/8196658072eee684. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/agent/harness/definition.rs:763

        let custom = super::definition_loader::load_from_workspace(workspace)?;
        for def in custom {
            tracing::info!(
                id = %def.id,
                source = ?def.source,
                "[agent_defs] loaded custom definition (overrides any built-in with the same id)"
            );
            reg.insert(def);
        }

        // Re-validate the tier hierarchy after custom overrides are
        // merged in — a workspace TOML can legally replace a built-in
        // (same id) and is held to the same spawn-hierarchy contract
        // as the bundled set. See
        // [`crate::openhuman::agent::registry::agents::loader::validate_tier_hierarchy`].
        let snapshot: Vec<AgentDefinition> = reg.list().into_iter().cloned().collect();
        crate::openhuman::agent::registry::agents::validate_tier_hierarchy(&snapshot).map_err(
            |e| {
                anyhow::anyhow!(
                    "agent registry rejected after merging workspace overrides from {}: {}",
                    workspace.display(),
                    e
                )
            },
        )?;

        Ok(reg)
    }

    /// Convenience: resolve the default workspace via
    /// [`crate::openhuman::config::Config::load_or_init`] and load from
    /// it. Built for sync CLI call sites (`openhuman agent list`,
    /// future inspection tools) so they don't re-implement the Config
    /// → workspace resolution dance. Must NOT be called from an
    /// existing tokio runtime — construct a runtime and `block_on`.
    pub async fn load_for_default_workspace() -> Result<Self> {
        let config = crate::openhuman::config::Config::load_or_init().await?;

View on GitHub (pinned to 7491200858)