{"record":{"id":"8196658072eee684","repo":"tinyhumansai/openhuman","slug":"agent-registry-rejected-after-merging-workspace-ov","errorCode":null,"errorMessage":"agent registry rejected after merging workspace overrides from {}: {}","messagePattern":"agent registry rejected after merging workspace overrides from (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/harness/definition.rs","lineNumber":763,"sourceCode":"        let custom = super::definition_loader::load_from_workspace(workspace)?;\n        for def in custom {\n            tracing::info!(\n                id = %def.id,\n                source = ?def.source,\n                \"[agent_defs] loaded custom definition (overrides any built-in with the same id)\"\n            );\n            reg.insert(def);\n        }\n\n        // Re-validate the tier hierarchy after custom overrides are\n        // merged in — a workspace TOML can legally replace a built-in\n        // (same id) and is held to the same spawn-hierarchy contract\n        // as the bundled set. See\n        // [`crate::openhuman::agent::registry::agents::loader::validate_tier_hierarchy`].\n        let snapshot: Vec<AgentDefinition> = reg.list().into_iter().cloned().collect();\n        crate::openhuman::agent::registry::agents::validate_tier_hierarchy(&snapshot).map_err(\n            |e| {\n                anyhow::anyhow!(\n                    \"agent registry rejected after merging workspace overrides from {}: {}\",\n                    workspace.display(),\n                    e\n                )\n            },\n        )?;\n\n        Ok(reg)\n    }\n\n    /// Convenience: resolve the default workspace via\n    /// [`crate::openhuman::config::Config::load_or_init`] and load from\n    /// it. Built for sync CLI call sites (`openhuman agent list`,\n    /// future inspection tools) so they don't re-implement the Config\n    /// → workspace resolution dance. Must NOT be called from an\n    /// existing tokio runtime — construct a runtime and `block_on`.\n    pub async fn load_for_default_workspace() -> Result<Self> {\n        let config = crate::openhuman::config::Config::load_or_init().await?;","sourceCodeStart":745,"sourceCodeEnd":781,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/harness/definition.rs#L745-L781","documentation":"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.","triggerScenarios":"Thrown at src/openhuman/agent/harness/definition.rs:763 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the tier/subagent declarations in the workspace agent TOML at the logged path so the hierarchy is valid","Remove or rename the workspace override that clashes with the built-in agent id","Compare the workspace file's tier fields against the built-in definition it replaces and align them"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}