{"record":{"id":"010ae920dc908430","repo":"tinyhumansai/openhuman","slug":"unknown-dependency-depends-on","errorCode":null,"errorMessage":"unknown dependency: {depends_on}","messagePattern":"unknown dependency: (.+?)","errorType":"validation","errorClass":"TeamError","httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/orchestration/agent_teams/ops.rs","lineNumber":409,"sourceCode":"/// Rejects self-dependency, unknown dependency ids, and any edge that would\n/// introduce a cycle. The cycle check builds the full graph (existing tasks +\n/// the new task with its proposed deps) and runs Kahn's algorithm — the same\n/// shape used for workflow phase graphs in `workflow_runs::ops::has_cycle`.\nfn validate_dependencies(\n    new_task_id: &str,\n    depends_on: &[String],\n    existing: &[AgentTeamTask],\n) -> Result<()> {\n    let known: HashSet<&str> = existing.iter().map(|t| t.id.as_str()).collect();\n\n    for dep in depends_on {\n        if dep == new_task_id {\n            return Err(anyhow!(TeamError::SelfDependency {\n                task_id: new_task_id.to_string(),\n            }));\n        }\n        if !known.contains(dep.as_str()) {\n            return Err(anyhow!(TeamError::UnknownDependency {\n                depends_on: dep.clone(),\n            }));\n        }\n    }\n\n    if has_task_cycle(new_task_id, depends_on, existing) {\n        return Err(anyhow!(TeamError::CyclicDependency));\n    }\n\n    Ok(())\n}\n\n/// Kahn's-algorithm cycle check over the task dependency graph (existing tasks\n/// plus the candidate new task). Edge `dep -> task` means `task` depends on\n/// `dep`. Edges pointing at unknown ids are ignored here (rejected separately).\nfn has_task_cycle(\n    new_task_id: &str,\n    new_depends_on: &[String],","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/orchestration/agent_teams/ops.rs#L391-L427","documentation":"validate_dependencies found a depends_on entry that matches no existing task id in the team (TeamError::UnknownDependency). The known set is built from the team's current tasks; the faulting input is the unrecognized dependency id — typo'd, deleted, or belonging to another team.","triggerScenarios":"Thrown at src/openhuman/agent/orchestration/agent_teams/ops.rs:409 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List the team's tasks and correct the dependency id","Create the missing task first if it was never added","Remove dangling references to deleted tasks from depends_on"],"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"}