From 70d39bb4f31568b8e310f72ddf29347f94f78096 Mon Sep 17 00:00:00 2001 From: MATHEUS PINHEIRO RAPOSO Date: Thu, 29 Oct 2026 19:13:36 +0000 Subject: [PATCH] Three tests pass on Windows with an 8.3 TEMP path (#8968) On a Windows account whose %TEMP% is a short (8.3) path, such as C:\Users\MATHEU~1\AppData\Local\Temp, three tests failed because they built their folders from std::env::temp_dir(), and the agent file scope refuses short names ("not allowed for this agent: short (8.3) names such as `PROGRA~1`"): - engine: cmd::render::settings_tests::embedded_hdr_capture_rejects_parameters_scope_and_cpu_primaries_without_mutation - ui-egui: agent_chat::tests::file_actions_wait_for_the_user - ui-egui: agent_chat::tests::permission_modes_decide_what_asks They now use vfs::temp_dir(), which spells the folder with long names, as libraries_tests and motion_tests already do (#1385, #1211). Checked on Windows 11 x64 with the 8.3 TEMP: the agent_chat and render::settings tests (113) pass, and clippy -D warnings is clean for both crates. Co-authored-by: Claude Opus 5.5 --- crates/engine/src/cmd/render/settings_tests.rs | 2 +- crates/ui-egui/src/agent_chat/tests.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/render/settings_tests.rs b/crates/engine/src/cmd/render/settings_tests.rs index ea0178f0d..ee567667d 100644 --- a/crates/engine/src/cmd/render/settings_tests.rs +++ b/crates/engine/src/cmd/render/settings_tests.rs @@ -625,7 +625,7 @@ fn embedded_hdr_capture_rejects_parameters_scope_and_cpu_primaries_without_mutat assert_eq!(state, (s.revision, s.undo.len(), s.redo.len())); } let nonce = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_nanos(); - let dir = std::env::temp_dir().join(format!("solidcraft-hdr-scope-{}-{nonce}", std::process::id())); + let dir = solidcraft_io::vfs::temp_dir().join(format!("solidcraft-hdr-scope-{}-{nonce}", std::process::id())); std::fs::create_dir(&dir).unwrap(); let allowed = dir.join("allowed"); std::fs::create_dir(&allowed).unwrap(); diff --git a/crates/ui-egui/src/agent_chat/tests.rs b/crates/ui-egui/src/agent_chat/tests.rs index ee177a3aa..56828778e 100644 --- a/crates/ui-egui/src/agent_chat/tests.rs +++ b/crates/ui-egui/src/agent_chat/tests.rs @@ -214,7 +214,7 @@ fn a_messages_changes_undo_as_one_step() { #[test] fn file_actions_wait_for_the_user() { let (mut app, tx) = app_in_a_turn(); - let dir = std::env::temp_dir().join(format!("sc-agent-chat-approve-{}", std::process::id())); + let dir = solidcraft_engine::io::vfs::temp_dir().join(format!("sc-agent-chat-approve-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("a.solidcraft"); let save = json!({"command": "file.save", "params": {"path": path.to_string_lossy()}, "allow_paths": [dir.to_string_lossy()]}); @@ -466,7 +466,7 @@ fn permission_modes_decide_what_asks() { decline_all(&mut app, "test"); // Allow everything, set for this agent only. app.preferences.agent_permissions.insert("codex".into(), agents::Mode::All); - let dir = std::env::temp_dir().join(format!("sc-agent-chat-all-{}", std::process::id())); + let dir = solidcraft_engine::io::vfs::temp_dir().join(format!("sc-agent-chat-all-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("b.solidcraft"); let save = ask(