{"record":{"id":"ab21d7f7981e92c8","repo":"aaif-goose/goose","slug":"working-dir-could-not-be-resolved","errorCode":null,"errorMessage":"working_dir '{}' could not be resolved: {}","messagePattern":"working_dir '(.+?)' could not be resolved: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/goose/src/agents/platform_extensions/summon.rs","lineNumber":2088,"sourceCode":"        }\n\n        Some(lines.join(\"\\n\"))\n    }\n}\n\n/// Resolve a requested `working_dir` override against the parent session\n/// directory. Relative paths are joined to the parent dir; the result must\n/// canonicalize to an existing directory contained within the parent dir.\nfn resolve_working_dir(parent_dir: &Path, requested: &str) -> Result<PathBuf, anyhow::Error> {\n    let requested_path = PathBuf::from(requested);\n    let resolved = if requested_path.is_absolute() {\n        requested_path\n    } else {\n        parent_dir.join(&requested_path)\n    };\n    let canonical = resolved\n        .canonicalize()\n        .map_err(|e| anyhow::anyhow!(\"working_dir '{}' could not be resolved: {}\", requested, e))?;\n    let parent_canonical = parent_dir\n        .canonicalize()\n        .unwrap_or_else(|_| parent_dir.to_path_buf());\n    if !canonical.starts_with(&parent_canonical) {\n        anyhow::bail!(\n            \"working_dir '{}' is outside the parent session directory\",\n            requested\n        );\n    }\n    if !canonical.is_dir() {\n        anyhow::bail!(\"working_dir '{}' is not a directory\", requested);\n    }\n    Ok(canonical)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;","sourceCodeStart":2070,"sourceCodeEnd":2106,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/agents/platform_extensions/summon.rs#L2070-L2106","documentation":"Error \"working_dir '{}' could not be resolved: {}\" thrown in aaif-goose/goose.","triggerScenarios":"Thrown at crates/goose/src/agents/platform_extensions/summon.rs:2088 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"}