{"record":{"id":"4f4aaf8282f74f74","repo":"aaif-goose/goose","slug":"could-not-retrieve-sub-recipe","errorCode":null,"errorMessage":"Could not retrieve sub-recipe '{}': {}","messagePattern":"Could not retrieve sub-recipe '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/recipes/extract_from_cli.rs","lineNumber":42,"sourceCode":"\n    if !additional_sub_recipes.is_empty() {\n        let mut all_sub_recipes = recipe.sub_recipes.clone().unwrap_or_default();\n        for sub_recipe_name in additional_sub_recipes {\n            match load_recipe_file(&sub_recipe_name) {\n                Ok(recipe_file) => {\n                    let name = extract_recipe_name(&sub_recipe_name);\n                    let recipe_file_path = recipe_file.file_path;\n                    let additional_sub_recipe = SubRecipe {\n                        path: recipe_file_path.to_string_lossy().to_string(),\n                        name,\n                        values: None,\n                        sequential_when_repeated: true,\n                        description: None,\n                    };\n                    all_sub_recipes.push(additional_sub_recipe);\n                }\n                Err(e) => {\n                    return Err(anyhow!(\n                        \"Could not retrieve sub-recipe '{}': {}\",\n                        sub_recipe_name,\n                        e\n                    ));\n                }\n            }\n        }\n        recipe.sub_recipes = Some(all_sub_recipes);\n    }\n\n    let input_config = InputConfig {\n        contents: recipe.prompt.clone().filter(|s| !s.trim().is_empty()),\n        additional_system_prompt: recipe.instructions.clone(),\n    };\n\n    Ok((input_config, recipe))\n}\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/recipes/extract_from_cli.rs#L24-L60","documentation":"When extra sub-recipes are passed on the CLI, extract_recipe_info_from_cli resolves each one via load_recipe_file (crates/goose-cli/src/recipes/extract_from_cli.rs:28-46). If that lookup fails (file not found, unreadable, or the name cannot be resolved through the configured recipe sources), the operation aborts with this error naming the offending sub-recipe and the underlying cause.","triggerScenarios":"Invoking a recipe with additional sub-recipes (`goose run --recipe ... --with-subrecipe <name>` style flows) where the sub-recipe identifier is neither an existing local file path nor discoverable in the configured recipe locations (including GOOSE_RECIPE_GITHUB_REPO when set), or the file exists but is unreadable.","commonSituations":"Typo in the sub-recipe name, passing a relative path from the wrong working directory, a sub-recipe folder in the GitHub recipe repo lacking a recipe.{ext} file, or GOOSE_RECIPE_GITHUB_REPO unset while expecting remote resolution.","solutions":["Verify the sub-recipe identifier exactly matches a local file path or a known recipe name; fix typos and run from the directory that makes relative paths valid","If it should come from GitHub, confirm GOOSE_RECIPE_GITHUB_REPO is set to owner/repo and that the folder contains a recipe.yaml (or another supported extension)","Read the chained `: {}` cause — it is the underlying load_recipe_file error and states precisely why the lookup failed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before passing sub-recipes, confirm each resolves to a readable file\nfn sub_recipe_paths_valid(names: &[String]) -> anyhow::Result<()> {\n    for name in names {\n        if !std::path::Path::new(name).exists() {\n            anyhow::bail!(\"sub-recipe '{name}' does not exist as a local file; \\n                              check GOOSE_RECIPE_GITHUB_REPO for remote resolution\");\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"// Rust: match on the load and report name + cause together\nif let Err(e) = load_recipe_file(&sub_recipe_name) {\n    eprintln!(\"sub-recipe '{sub_recipe_name}' failed to load: {e:#}\");\n    continue; // or abort, depending on policy\n}","preventionTips":["Pin sub-recipe identifiers to checked-in paths or names verified via `goose recipe list`","Set GOOSE_RECIPE_GITHUB_REPO consistently in the environment that runs goose","Fail fast on the first missing sub-recipe in scripts instead of passing long lists blindly"],"tags":["goose-cli","recipes","sub-recipes","configuration"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}