{"record":{"id":"6a7154ab84e59ff5","repo":"aaif-goose/goose","slug":"failed-to-render-subagent-system-prompt","errorCode":null,"errorMessage":"Failed to render subagent system prompt: {}","messagePattern":"Failed to render subagent system prompt: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/goose/src/agents/subagent_handler.rs","lineNumber":269,"sourceCode":"        .filter(super::reply_parts::is_tool_visible_to_model)\n        .collect();\n    render_template(\n        \"subagent_system.md\",\n        &SubagentPromptContext {\n            max_turns: task_config\n                .max_turns\n                .expect(\"TaskConfig always sets max_turns\"),\n            subagent_id: session_id.to_string(),\n            task_instructions: system_instructions,\n            tool_count: tools.len(),\n            available_tools: tools\n                .iter()\n                .map(|t| t.name.to_string())\n                .collect::<Vec<_>>()\n                .join(\", \"),\n        },\n    )\n    .map_err(|e| anyhow!(\"Failed to render subagent system prompt: {}\", e))\n}\n\nasync fn get_final_output(agent: &Agent, has_response_schema: bool) -> Option<String> {\n    if has_response_schema {\n        agent\n            .final_output_tool\n            .lock()\n            .await\n            .as_ref()\n            .and_then(|tool| tool.final_output.clone())\n    } else {\n        None\n    }\n}\n\n#[expect(deprecated)]\npub fn create_tool_notification(\n    content: &MessageContent,","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/agents/subagent_handler.rs#L251-L287","documentation":"Error \"Failed to render subagent system prompt: {}\" thrown in aaif-goose/goose.","triggerScenarios":"Thrown at crates/goose/src/agents/subagent_handler.rs:269 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}