{"record":{"id":"613968b699fd9512","repo":"tinyhumansai/openhuman","slug":"working-directory-does-not-exist-and-could-no","errorCode":null,"errorMessage":"Working directory '{}' does not exist and could not be created: {e}. Set a valid path in Settings → Agent access → Working directory.","messagePattern":"Working directory '(.+?)' does not exist and could not be created: (.+?)\\. Set a valid path in Settings → Agent access → Working directory\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/config/ops/agent.rs","lineNumber":364,"sourceCode":"        );\n    }\n    tracing::info!(\n        workspace = %redact_home(&config.workspace_dir),\n        action = %redact_home(&action_dir),\n        \"[startup] workspace (internal state) and action sandbox (tool cwd) directories configured\"\n    );\n}\n\n/// Ensure `dir` is usable as a process working directory: it must exist (we\n/// attempt to create it if missing — covers a dir deleted after launch) and\n/// resolve to a directory. Returns a descriptive error naming the path and the\n/// Settings location to fix it, instead of letting the OS surface an opaque\n/// `ERROR_DIRECTORY` (os error 267) from `CreateProcessW`. See issue #3353\n/// (Fix 2). Cheap stat-only calls on the happy path.\npub fn ensure_usable_cwd(dir: &Path) -> anyhow::Result<()> {\n    if !dir.exists() {\n        std::fs::create_dir_all(dir).map_err(|e| {\n            anyhow::anyhow!(\n                \"Working directory '{}' does not exist and could not be created: {e}. \\\n                 Set a valid path in Settings → Agent access → Working directory.\",\n                dir.display()\n            )\n        })?;\n    }\n    if !dir.is_dir() {\n        anyhow::bail!(\n            \"Working directory '{}' is not a directory. \\\n             Set a valid path in Settings → Agent access → Working directory.\",\n            dir.display()\n        );\n    }\n    Ok(())\n}\n\nfn action_dir_source(config: &Config) -> &'static str {\n    if crate::openhuman::config::action_dir_env_override().is_some() {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/config/ops/agent.rs#L346-L382","documentation":"Startup validation of the configured agent working directory (action_dir): the path does not exist, an attempt to create it failed (permissions, invalid path), or it resolves to a non-directory. The message deliberately names the Settings location so the user fixes configuration instead of seeing an opaque OS error 267 from a later spawn.","triggerScenarios":"Thrown at src/openhuman/config/ops/agent.rs:364 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a valid, creatable path in Settings → Agent access → Working directory","Grant the app write permission on the parent directory","Remove any file occupying the path"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}