aaif-goose/goose · error · anyhow::Error
working_dir '{}' could not be resolved: {}
Error message
working_dir '{}' could not be resolved: {} What it means
Error "working_dir '{}' could not be resolved: {}" thrown in aaif-goose/goose.
Source
Thrown at crates/goose/src/agents/platform_extensions/summon.rs:2088
}
Some(lines.join("\n"))
}
}
/// Resolve a requested `working_dir` override against the parent session
/// directory. Relative paths are joined to the parent dir; the result must
/// canonicalize to an existing directory contained within the parent dir.
fn resolve_working_dir(parent_dir: &Path, requested: &str) -> Result<PathBuf, anyhow::Error> {
let requested_path = PathBuf::from(requested);
let resolved = if requested_path.is_absolute() {
requested_path
} else {
parent_dir.join(&requested_path)
};
let canonical = resolved
.canonicalize()
.map_err(|e| anyhow::anyhow!("working_dir '{}' could not be resolved: {}", requested, e))?;
let parent_canonical = parent_dir
.canonicalize()
.unwrap_or_else(|_| parent_dir.to_path_buf());
if !canonical.starts_with(&parent_canonical) {
anyhow::bail!(
"working_dir '{}' is outside the parent session directory",
requested
);
}
if !canonical.is_dir() {
anyhow::bail!("working_dir '{}' is not a directory", requested);
}
Ok(canonical)
}
#[cfg(test)]
mod tests {
use super::*;View on GitHub (pinned to 3810898a74)
When it happens
Trigger: Thrown at crates/goose/src/agents/platform_extensions/summon.rs:2088 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16).
Data as JSON: /api/errors/ab21d7f7981e92c8.
Report an issue: GitHub.