{"record":{"id":"14f9889608dca21f","repo":"aaif-goose/goose","slug":"failed-to-get-prompt","errorCode":null,"errorMessage":"Failed to get prompt: {}","messagePattern":"Failed to get prompt: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose/src/agents/agent.rs","lineNumber":3710,"sourceCode":"            .await\n            .map_err(|e| anyhow!(\"Failed to list prompts: {}\", e))?;\n\n        if let Some(extension) = prompts\n            .iter()\n            .find(|(_, prompt_list)| prompt_list.iter().any(|p| p.name == name))\n            .map(|(extension, _)| extension)\n        {\n            return self\n                .extension_manager\n                .get_prompt(\n                    session_id,\n                    extension,\n                    name,\n                    arguments,\n                    CancellationToken::default(),\n                )\n                .await\n                .map_err(|e| anyhow!(\"Failed to get prompt: {}\", e));\n        }\n\n        Err(anyhow!(\"Prompt '{}' not found\", name))\n    }\n\n    pub async fn get_plan_prompt(&self, session_id: &str) -> Result<String> {\n        let tools = self\n            .extension_manager\n            .get_prefixed_tools(session_id, None)\n            .await?;\n        let tools_info = tools\n            .into_iter()\n            .map(|tool| {\n                ToolInfo::new(\n                    &tool.name,\n                    tool.description\n                        .as_ref()\n                        .map(|d| d.as_ref())","sourceCodeStart":3692,"sourceCodeEnd":3728,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/agents/agent.rs#L3692-L3728","documentation":"Thrown when the prompt was located on an extension but ExtensionManager::get_prompt failed executing it. The '{}' is the underlying error: arguments not matching the prompt's input schema, the extension erroring while rendering the prompt, or a cancellation/timeout during the call. Discovery succeeded; execution failed.","triggerScenarios":"Calling get_prompt with an arguments Value whose fields/types do not match the prompt's declared schema, or the extension process failing (crash, timeout, internal error) while producing the prompt.","commonSituations":"Passing extra/missing arguments to a parameterized prompt; schema drift after the extension updated its prompt definition; extension runtime bugs; long-running prompt generation hitting the timeout.","solutions":["Check the embedded '{}' — schema mismatch errors usually name the expected argument","Inspect the prompt's argument schema (prompts/list describes it) and pass exactly those fields/types","Restart or fix the extension if it crashed mid-call","Retry once — timeouts can be transient under load"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Rust — validate arguments against the prompt's declared schema before calling\nlet prompts = agent.extension_manager\n    .list_prompts(session_id, CancellationToken::default()).await?;\nlet schema = prompts.iter().flat_map(|(_, ps)| ps.iter())\n    .find(|p| p.name == name)\n    .and_then(|p| p.arguments.clone().map(|a| serde_json::to_value(a).ok()).flatten());\n// ensure every required argument key in `schema` is present in `arguments`","typeGuard":null,"tryCatchPattern":"// Rust — distinguish execution failure from not-found\nmatch agent.get_prompt(session_id, name, args).await {\n    Ok(r) => Ok(r),\n    Err(e) if e.to_string().contains(\"Failed to get prompt\") => {\n        // extension-level failure: restart/disable the extension, then retry once\n        Err(e)\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Pass exactly the arguments the prompt declares; do not invent extra fields","Pin extension versions so prompt schemas do not drift","Handle extension restarts gracefully in long-running sessions"],"tags":["extensions","mcp","prompts","arguments"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}