diff --git a/crates/openhuman-core/src/attachments/mod.rs b/crates/openhuman-core/src/attachments/mod.rs index 5d2b31d5659..e10113692be 100644 --- a/crates/openhuman-core/src/attachments/mod.rs +++ b/crates/openhuman-core/src/attachments/mod.rs @@ -202,9 +202,10 @@ pub(crate) async fn thread_action_dir( let Some(thread_id) = thread_id.filter(|id| !id.is_empty()) else { return Ok(config.action_dir.clone()); }; - let bound = crate::threads::ops::thread_working_dir(ctx, threads_dir.to_path_buf(), thread_id) - .await - .map_err(anyhow::Error::msg)?; + let bound = + crate::threads::ops::thread_working_dir(ctx, config, threads_dir.to_path_buf(), thread_id) + .await + .map_err(anyhow::Error::msg)?; Ok(bound.unwrap_or_else(|| config.action_dir.clone())) } diff --git a/crates/openhuman-core/src/config/ops/agent_paths.rs b/crates/openhuman-core/src/config/ops/agent_paths.rs index 82acbac871c..14bad61fb19 100644 --- a/crates/openhuman-core/src/config/ops/agent_paths.rs +++ b/crates/openhuman-core/src/config/ops/agent_paths.rs @@ -200,10 +200,9 @@ fn agent_paths_payload(config: &Config) -> serde_json::Value { } /// Validate a user-chosen files folder (#5505) and create it. Fail-closed: -/// the path must be absolute, not an existing file, not a protected location -/// (credential stores, OS directories), and not inside the OpenHuman data -/// directory — the point of the folder is that the user can see it, and the -/// data dir holds internal state. +/// the path must be absolute, not an existing file, and pass +/// [`refuse_protected_folder`] — the point of the folder is that the user can +/// see it, and the data dir holds internal state. async fn validate_files_dir(raw: &str, config: &Config) -> Result { let expanded = expand_tilde(raw); let candidate = PathBuf::from(&expanded); @@ -217,24 +216,69 @@ async fn validate_files_dir(raw: &str, config: &Config) -> Result Result<(), String> { + let resolved = canonical_prefix(candidate); + if crate::security::SecurityPolicy::is_always_forbidden_async(candidate).await + || crate::security::SecurityPolicy::is_always_forbidden_async(&resolved).await + { + log::debug!("[config][agent_paths] {kind} refused: protected location"); return Err(format!( - "files_dir cannot be a protected system or credential folder: {expanded}" + "{kind} cannot be a protected system or credential folder: {expanded}" )); } - let mut internal = vec![config.workspace_dir.clone()]; - if let Ok(root) = crate::config::default_root_openhuman_dir() { - internal.push(root); - } - if internal.iter().any(|dir| path_within(&candidate, dir)) { + refuse_data_folder(kind, candidate, expanded, config) +} + +/// Refuse an agent folder that sits inside OpenHuman's state (the workspace +/// or the data root) or contains it (also the folder holding this config, +/// whose credential files sit next to it). Fails closed when the data root +/// can't be resolved. +pub(crate) fn refuse_data_folder( + kind: &str, + candidate: &Path, + expanded: &str, + config: &Config, +) -> Result<(), String> { + let root = crate::config::default_root_openhuman_dir().map_err(|e| { + format!("{kind} can't be checked: the OpenHuman data folder is unknown: {e}") + })?; + let state = [config.workspace_dir.clone(), root]; + let config_dir = config + .config_path + .parent() + .filter(|dir| !dir.as_os_str().is_empty()); + let inside = state.iter().any(|dir| path_within(candidate, dir)); + let contains = state + .iter() + .map(PathBuf::as_path) + .chain(config_dir) + .any(|dir| path_within(dir, candidate)); + if inside || contains { + log::debug!( + "[config][agent_paths] {kind} refused: inside={inside} contains={contains} the data folder" + ); return Err(format!( - "files_dir must not be inside the OpenHuman data folder: {expanded}" + "{kind} must not be inside or contain the OpenHuman data folder: {expanded}" )); } - tokio::fs::create_dir_all(&candidate) - .await - .map_err(|e| format!("failed to create files_dir {expanded}: {e}"))?; - Ok(candidate) + Ok(()) } /// `path` equals or sits under `dir`, comparing canonical forms so a @@ -265,9 +309,11 @@ pub(crate) fn canonical_prefix(path: &Path) -> PathBuf { /// Applies an edit to the agent's `action_dir` sandbox root. /// /// Validation (fail-closed): the path is trimmed and `~`-expanded; it must be -/// **absolute**; it must not be an existing *file*; and it must not equal +/// **absolute**; it must not be an existing *file*; it must not equal /// `workspace_dir` (which holds memory DBs / tokens and must never become the -/// agent-writable root). A missing directory is auto-created (mirroring the +/// agent-writable root); and it must pass [`refuse_protected_folder`] (no +/// credential store or OS directory, even through a symlink, and nothing inside +/// the OpenHuman data folder). A missing directory is auto-created (mirroring the /// startup auto-create in `channels/runtime/startup.rs`). An empty input clears /// the override and reverts `action_dir` to the default. /// @@ -317,6 +363,8 @@ pub async fn apply_agent_paths_settings( ); } + refuse_protected_folder("action_dir", &candidate, &expanded, config).await?; + if !candidate.exists() { tokio::fs::create_dir_all(&candidate) .await diff --git a/crates/openhuman-core/src/config/ops/mod.rs b/crates/openhuman-core/src/config/ops/mod.rs index fdd244f2b03..fad736fdeb5 100644 --- a/crates/openhuman-core/src/config/ops/mod.rs +++ b/crates/openhuman-core/src/config/ops/mod.rs @@ -77,6 +77,7 @@ pub use agent::{ get_autonomy_settings, load_and_apply_agent_settings, load_and_apply_autonomy_settings, AgentSettingsPatch, AutonomySettingsPatch, }; +pub(crate) use agent_paths::refuse_data_folder; pub use agent_paths::{ apply_agent_paths_settings, ensure_agent_dirs, ensure_usable_cwd, expand_tilde, get_agent_paths, load_and_apply_agent_paths_settings, redact_home, AgentPathsPatch, diff --git a/crates/openhuman-core/src/config/ops_agent_paths_tests.rs b/crates/openhuman-core/src/config/ops_agent_paths_tests.rs index 76c7a488a55..8e19f4643cf 100644 --- a/crates/openhuman-core/src/config/ops_agent_paths_tests.rs +++ b/crates/openhuman-core/src/config/ops_agent_paths_tests.rs @@ -325,6 +325,101 @@ async fn apply_agent_paths_env_set_reports_source_env() { } } +/// The action_dir edit, expected to be refused without storing an override. +async fn action_dir_rejected(cfg: &mut Config, value: &std::path::Path) -> String { + let err = apply_agent_paths_settings( + cfg, + AgentPathsPatch { + action_dir: Some(value.to_string_lossy().to_string()), + files_dir: None, + }, + ) + .await + .expect_err("action_dir must be rejected"); + assert!( + cfg.action_dir_override.is_none(), + "a rejected value is not stored" + ); + err +} + +/// TS-E2E-021: the agent's working folder becomes its read-write root, so a +/// credential store, an OS directory or a symlink to one must be refused. +#[tokio::test] +async fn apply_agent_paths_rejects_a_protected_action_dir() { + let _g = ENV_LOCK.lock().await; + unsafe { + std::env::remove_var("OPENHUMAN_ACTION_DIR"); + } + let tmp = tempdir().unwrap(); + let mut cfg = tmp_config(&tmp); + let ssh = tmp.path().join(".ssh"); + std::fs::create_dir_all(&ssh).unwrap(); + + let err = action_dir_rejected(&mut cfg, &ssh).await; + assert!(err.contains("protected"), "{err}"); + #[cfg(unix)] + { + let err = action_dir_rejected(&mut cfg, std::path::Path::new("/etc")).await; + assert!(err.contains("protected"), "{err}"); + let link = tmp.path().join("projects-link"); + std::os::unix::fs::symlink(&ssh, &link).unwrap(); + let err = action_dir_rejected(&mut cfg, &link).await; + assert!(err.contains("protected"), "{err}"); + } +} + +/// TS-E2E-021: a folder inside the OpenHuman data folder holds internal state +/// and must not become the agent's working folder. +#[tokio::test] +async fn apply_agent_paths_rejects_an_action_dir_inside_the_data_folder() { + let _g = ENV_LOCK.lock().await; + unsafe { + std::env::remove_var("OPENHUMAN_ACTION_DIR"); + } + let tmp = tempdir().unwrap(); + let mut cfg = tmp_config(&tmp); + let inside = cfg.workspace_dir.join("vault"); + + let err = action_dir_rejected(&mut cfg, &inside).await; + assert!(err.contains("OpenHuman data folder"), "{err}"); + assert!(!inside.exists(), "nothing is created for a rejected value"); +} + +/// An `OPENHUMAN_WORKSPACE` profile keeps `config.toml` and its credential +/// files beside the workspace, so the profile folder itself (or any folder +/// above it) must not become the agent's working folder. A sibling folder in +/// the profile reaches none of that state and stays allowed. +#[tokio::test] +async fn apply_agent_paths_rejects_an_action_dir_that_contains_the_profile() { + let _g = ENV_LOCK.lock().await; + unsafe { + std::env::remove_var("OPENHUMAN_ACTION_DIR"); + } + let tmp = tempdir().unwrap(); + let profile = tmp.path().join("profile"); + let mut cfg = Config::default(); + cfg.workspace_dir = profile.join("workspace"); + cfg.config_path = profile.join("config.toml"); + std::fs::create_dir_all(&cfg.workspace_dir).unwrap(); + + for root in [profile.as_path(), tmp.path()] { + let err = action_dir_rejected(&mut cfg, root).await; + assert!(err.contains("OpenHuman data folder"), "{err}"); + } + let beside = profile.join("projects"); + apply_agent_paths_settings( + &mut cfg, + AgentPathsPatch { + action_dir: Some(beside.to_string_lossy().to_string()), + files_dir: None, + }, + ) + .await + .expect("a folder beside the profile's state is allowed"); + assert_eq!(cfg.action_dir_override.as_deref(), Some(beside.as_path())); +} + // --- #3353 regression tests ------------------------------------------------- #[test] diff --git a/crates/openhuman-core/src/config/ops_files_dir_tests.rs b/crates/openhuman-core/src/config/ops_files_dir_tests.rs index f41414ec551..b761ddc534f 100644 --- a/crates/openhuman-core/src/config/ops_files_dir_tests.rs +++ b/crates/openhuman-core/src/config/ops_files_dir_tests.rs @@ -181,6 +181,22 @@ async fn a_symlinked_route_into_the_data_folder_is_rejected() { assert!(err.contains("OpenHuman data folder"), "{err}"); } +/// TS-E2E-016: a symlink into a credential store is the credential store; the +/// floor is asked about the resolved path, not only the spelling. +#[cfg(unix)] +#[tokio::test] +async fn a_symlink_into_a_credential_folder_is_rejected() { + let tmp = tempdir().unwrap(); + let mut cfg = tmp_config(&tmp); + let ssh = tmp.path().join(".ssh"); + std::fs::create_dir_all(&ssh).unwrap(); + let link = tmp.path().join("Documents-link"); + std::os::unix::fs::symlink(&ssh, &link).unwrap(); + + let err = rejected(&mut cfg, &link.to_string_lossy()).await; + assert!(err.contains("protected"), "{err}"); +} + /// Changing the folder affects new files only: a file made in the previous /// folder keeps resolving, because that folder is recorded as trusted. #[tokio::test] diff --git a/crates/openhuman-core/src/threads/ops/crud.rs b/crates/openhuman-core/src/threads/ops/crud.rs index 9f0eda08a55..a5cd9242d5d 100644 --- a/crates/openhuman-core/src/threads/ops/crud.rs +++ b/crates/openhuman-core/src/threads/ops/crud.rs @@ -71,8 +71,16 @@ pub async fn thread_create_new( request: CreateConversationThreadRequest, ) -> Result>, String> { let dir = workspace_dir().await?; - let working_dir = - super::working_dir::validate_working_dir(request.action_dir.as_deref()).await?; + let config = ctx + .load_config() + .await + .map_err(|e| format!("load config: {e}"))?; + let working_dir = super::working_dir::validate_working_dir_for_store( + request.action_dir.as_deref(), + &config, + &dir, + ) + .await?; let id = format!("thread-{}", uuid::Uuid::new_v4()); let now = chrono::Local::now(); let title = format!("Chat {} {}", now.format("%b %-d"), now.format("%-I:%M %p")); diff --git a/crates/openhuman-core/src/threads/ops/working_dir.rs b/crates/openhuman-core/src/threads/ops/working_dir.rs index f9acc3e53ea..7d0df26cf4b 100644 --- a/crates/openhuman-core/src/threads/ops/working_dir.rs +++ b/crates/openhuman-core/src/threads/ops/working_dir.rs @@ -8,6 +8,7 @@ //! in another. use super::support::{counts, envelope, thread_to_summary, workspace_dir}; +use crate::config::Config; use crate::core::runtime::DispatchCtx; use crate::core::Outcome; use crate::security::SecurityPolicy; @@ -23,8 +24,12 @@ use std::path::{Path, PathBuf}; /// /// The folder must be an existing absolute directory outside the paths the /// security policy never opens (credential stores, system roots), the same -/// floor that holds with the autonomy policy disabled. -pub(crate) async fn validate_working_dir(raw: Option<&str>) -> Result, String> { +/// floor that holds with the autonomy policy disabled. Like the global +/// `action_dir`, it must neither sit inside nor contain OpenHuman's own state. +pub(crate) async fn validate_working_dir( + raw: Option<&str>, + config: &Config, +) -> Result, String> { let Some(raw) = raw.map(str::trim).filter(|raw| !raw.is_empty()) else { return Ok(None); }; @@ -44,19 +49,45 @@ pub(crate) async fn validate_working_dir(raw: Option<&str>) -> Result, + config: &Config, + store: &Path, +) -> Result, String> { + let validated = validate_working_dir(raw, config).await?; + if let Some(dir) = &validated { + if store != config.workspace_dir { + let mut store_config = config.clone(); + store_config.workspace_dir = store.to_path_buf(); + crate::config::ops::refuse_data_folder( + "working folder", + Path::new(dir), + dir, + &store_config, + )?; + } + } + Ok(validated) +} + /// The working folder bound to `thread_id`, if the thread exists and has one. /// /// An unusable bound folder is an error, rather than a reason to run in the /// global folder. This preserves the conversation's filesystem boundary. pub(crate) async fn thread_working_dir( ctx: &DispatchCtx, + config: &Config, workspace_dir: PathBuf, thread_id: &str, ) -> Result, String> { - let threads = conversations::blocking::list_threads(ctx.clone(), workspace_dir) + let threads = conversations::blocking::list_threads(ctx.clone(), workspace_dir.clone()) .await .map_err(|err| format!("failed to load thread working folder: {err}"))?; let bound = threads @@ -66,7 +97,7 @@ pub(crate) async fn thread_working_dir( let Some(bound) = bound else { return Ok(None); }; - match validate_working_dir(Some(&bound)).await { + match validate_working_dir_for_store(Some(&bound), config, &workspace_dir).await { Ok(Some(dir)) => Ok(Some(PathBuf::from(dir))), Ok(None) => Ok(None), Err(err) => Err(format!("thread working folder is unusable: {err}")), @@ -79,7 +110,12 @@ pub async fn thread_update_working_dir( request: UpdateConversationThreadWorkingDirRequest, ) -> Result>, ThreadsError> { let dir = workspace_dir().await?; - let working_dir = validate_working_dir(Some(&request.action_dir)).await?; + let config = ctx + .load_config() + .await + .map_err(|e| format!("load config: {e}"))?; + let working_dir = + validate_working_dir_for_store(Some(&request.action_dir), &config, &dir).await?; let Some(thread) = conversations::blocking::list_threads(ctx.clone(), dir.clone()) .await? .into_iter() diff --git a/crates/openhuman-core/src/threads/ops/working_dir_tests.rs b/crates/openhuman-core/src/threads/ops/working_dir_tests.rs index 69abee807fe..50fad7a27ad 100644 --- a/crates/openhuman-core/src/threads/ops/working_dir_tests.rs +++ b/crates/openhuman-core/src/threads/ops/working_dir_tests.rs @@ -1,9 +1,23 @@ use super::*; +/// A config whose state lives in `/profile` (workspace and config.toml). +fn profile_config(root: &Path) -> Config { + let mut config = Config::default(); + config.workspace_dir = root.join("profile").join("workspace"); + config.config_path = root.join("profile").join("config.toml"); + std::fs::create_dir_all(&config.workspace_dir).unwrap(); + config +} + #[tokio::test] async fn empty_request_uses_the_global_folder() { - assert_eq!(validate_working_dir(None).await.unwrap(), None); - assert_eq!(validate_working_dir(Some(" ")).await.unwrap(), None); + let temp = tempfile::tempdir().unwrap(); + let config = profile_config(temp.path()); + assert_eq!(validate_working_dir(None, &config).await.unwrap(), None); + assert_eq!( + validate_working_dir(Some(" "), &config).await.unwrap(), + None + ); } #[tokio::test] @@ -12,32 +26,100 @@ async fn existing_absolute_directory_is_canonicalized() { let nested = temp.path().join("project"); std::fs::create_dir(&nested).unwrap(); let raw = format!("{}/./", nested.display()); - let validated = validate_working_dir(Some(&raw)).await.unwrap().unwrap(); + let validated = validate_working_dir(Some(&raw), &profile_config(temp.path())) + .await + .unwrap() + .unwrap(); assert_eq!(PathBuf::from(validated), nested.canonicalize().unwrap()); } #[tokio::test] async fn relative_missing_file_and_forbidden_paths_are_rejected() { - assert!(validate_working_dir(Some("relative/dir")).await.is_err()); - let temp = tempfile::tempdir().unwrap(); + let config = profile_config(temp.path()); + assert!(validate_working_dir(Some("relative/dir"), &config) + .await + .is_err()); + + assert!(validate_working_dir( + Some(&temp.path().join("missing").display().to_string()), + &config + ) + .await + .is_err()); + + let file = temp.path().join("file.txt"); + std::fs::write(&file, "x").unwrap(); assert!( - validate_working_dir(Some(&temp.path().join("missing").display().to_string())) + validate_working_dir(Some(&file.display().to_string()), &config) .await .is_err() ); - let file = temp.path().join("file.txt"); - std::fs::write(&file, "x").unwrap(); - assert!(validate_working_dir(Some(&file.display().to_string())) - .await - .is_err()); - let ssh = temp.path().join(".ssh"); std::fs::create_dir(&ssh).unwrap(); - assert!(validate_working_dir(Some(&ssh.display().to_string())) + assert!( + validate_working_dir(Some(&ssh.display().to_string()), &config) + .await + .is_err() + ); +} + +/// TS-E2E-021 on the thread path: a thread's working folder becomes the +/// agent's `action_dir`, so it must not sit inside or contain OpenHuman's +/// state. A folder beside that state stays allowed. +#[tokio::test] +async fn a_working_folder_inside_or_around_the_data_folder_is_rejected() { + let temp = tempfile::tempdir().unwrap(); + let config = profile_config(temp.path()); + let vault = config.workspace_dir.join("vault"); + std::fs::create_dir(&vault).unwrap(); + for dir in [ + config.workspace_dir.as_path(), + vault.as_path(), + temp.path().join("profile").as_path(), + temp.path(), + ] { + let error = validate_working_dir(Some(&dir.display().to_string()), &config) + .await + .expect_err("a folder inside or around the data folder"); + assert!(error.contains("OpenHuman data folder"), "{dir:?}: {error}"); + } + let beside = temp.path().join("profile").join("projects"); + std::fs::create_dir(&beside).unwrap(); + assert!( + validate_working_dir(Some(&beside.display().to_string()), &config) + .await + .unwrap() + .is_some() + ); +} + +/// The thread store's workspace can differ from the context config's (single +/// user: the disk config vs the embedder config). A folder inside the store's +/// workspace is refused even when the context config doesn't name it. +#[tokio::test] +async fn a_working_folder_inside_the_thread_stores_workspace_is_rejected() { + let temp = tempfile::tempdir().unwrap(); + let config = profile_config(temp.path()); + let store = temp.path().join("store").join("workspace"); + let inside = store.join("threads"); + std::fs::create_dir_all(&inside).unwrap(); + let raw = inside.display().to_string(); + + assert!( + validate_working_dir(Some(&raw), &config).await.is_ok(), + "the context config alone doesn't cover the store's workspace" + ); + let error = validate_working_dir_for_store(Some(&raw), &config, &store) .await - .is_err()); + .expect_err("a folder inside the thread store's workspace"); + assert!(error.contains("OpenHuman data folder"), "{error}"); + assert!( + validate_working_dir_for_store(Some(&raw), &config, &config.workspace_dir) + .await + .is_ok() + ); } fn thread(id: &str, working_dir: Option) -> conversations::CreateConversationThread { @@ -56,6 +138,7 @@ fn thread(id: &str, working_dir: Option) -> conversations::CreateConvers async fn a_bound_folder_that_disappears_fails_closed() { // The thread must not silently fall back to the global folder. let temp = tempfile::tempdir().unwrap(); + let config = profile_config(temp.path()); let workspace = temp.path().join("internal"); let folder = temp.path().join("project"); std::fs::create_dir(&folder).unwrap(); @@ -69,14 +152,14 @@ async fn a_bound_folder_that_disappears_fails_closed() { .await .unwrap(); assert_eq!( - thread_working_dir(&ctx, workspace.clone(), "bound") + thread_working_dir(&ctx, &config, workspace.clone(), "bound") .await .unwrap(), Some(folder.clone()) ); std::fs::remove_dir(&folder).unwrap(); - let error = thread_working_dir(&ctx, workspace, "bound") + let error = thread_working_dir(&ctx, &config, workspace, "bound") .await .expect_err("a vanished bound folder"); assert!(error.contains("unusable"), "{error}"); @@ -119,7 +202,9 @@ async fn the_working_folder_is_fixed_after_the_first_message() { ) .await .unwrap(); - let error = thread_update_working_dir(&ctx, request(home.path())) + let other = home.path().join("other"); + std::fs::create_dir(&other).unwrap(); + let error = thread_update_working_dir(&ctx, request(&other)) .await .map(|_| ()) .expect_err("rebinding after the first message"); @@ -130,3 +215,39 @@ async fn the_working_folder_is_fixed_after_the_first_message() { "{error}" ); } + +/// The update RPC checks the folder against the loaded profile: with +/// `OPENHUMAN_WORKSPACE` set, the profile root holds config.toml and the +/// workspace, so binding it is refused and nothing is stored. +#[tokio::test] +async fn binding_the_profile_root_as_a_working_folder_is_refused() { + let _lock = crate::config::TEST_ENV_LOCK.lock().await; + let home = tempfile::tempdir().unwrap(); + let _workspace = crate::config::test_env::EnvVarGuard::workspace_unlocked(home.path()); + let ctx = DispatchCtx::ambient(); + let workspace = workspace_dir().await.unwrap(); + conversations::blocking::ensure_thread(ctx.clone(), workspace.clone(), thread("t", None)) + .await + .unwrap(); + let error = thread_update_working_dir( + &ctx, + UpdateConversationThreadWorkingDirRequest { + thread_id: "t".into(), + action_dir: home.path().display().to_string(), + }, + ) + .await + .map(|_| ()) + .expect_err("the profile root holds OpenHuman's state"); + assert!( + error.to_string().contains("OpenHuman data folder"), + "{error}" + ); + let stored = conversations::blocking::list_threads(ctx, workspace) + .await + .unwrap() + .into_iter() + .find(|thread| thread.id == "t") + .unwrap(); + assert_eq!(stored.working_dir, None, "a refused folder is not stored"); +} diff --git a/crates/openhuman-core/src/web_chat/run_task.rs b/crates/openhuman-core/src/web_chat/run_task.rs index 4e7d1128e7b..b8ddbe7f98e 100644 --- a/crates/openhuman-core/src/web_chat/run_task.rs +++ b/crates/openhuman-core/src/web_chat/run_task.rs @@ -122,7 +122,7 @@ pub(crate) async fn run_chat_task( // policy (which grants `action_dir` as a trusted root) and its tools are // all built on the thread's folder. let thread_dir = - crate::threads::ops::thread_working_dir(ctx, config.workspace_dir.clone(), thread_id) + crate::threads::ops::thread_working_dir(ctx, &config, config.workspace_dir.clone(), thread_id) .await?; if let Some(dir) = &thread_dir { log::debug!("[web-channel] thread working folder applied thread_id={thread_id}"); diff --git a/crates/openhuman-core/src/web_chat/turn_host.rs b/crates/openhuman-core/src/web_chat/turn_host.rs index 029968359a2..8337872c17d 100644 --- a/crates/openhuman-core/src/web_chat/turn_host.rs +++ b/crates/openhuman-core/src/web_chat/turn_host.rs @@ -156,6 +156,7 @@ impl WebHost { // tools are all built on the thread's folder. let thread_dir = crate::threads::ops::thread_working_dir( &ctx, + &config, config.workspace_dir.clone(), &request.thread_id, )