Hmbown/CodeWhale · error
create isolated home
Error message
create isolated home
What it means
This is a panic from `std::fs::create_dir_all(&home)` inside the test `confirmed_opt_out_keeps_configured_secrets_visible_to_the_model`. It fails when the isolated home directory cannot be created inside the tempdir — typically because the tempdir vanished or permissions/encoding issues prevented directory creation.
Solutions
- Verify the tempdir returned by tempfile is writable before creating subdirectories
- Check path length limits (MAX_PATH) if TMPDIR is deeply nested
- Rerun outside restrictive sandboxes or grant the test user create-directory permissions
Example fix
// before
std::fs::create_dir_all(&home).expect("create isolated home");
// after
std::fs::create_dir_all(&home).expect("create isolated home: check tempdir permissions and path length"); Defensive patterns
Strategy: validation
Validate before calling
assert!(fs::create_dir_all(&home).is_ok(), "cannot create isolated home under {}", tmp.path().display()); Prevention
- Confirm tempdir is writable before creating subdirectories
- Keep TMPDIR paths short to avoid path-length limits
- Exclude temp paths from antivirus/security scanning in CI
When it happens
Trigger: Running the test when `tmp.path().join("home")` cannot be created: parent tempdir removed mid-test, path too long, or filesystem denying mkdir under the temp root.
Common situations: Overly restrictive sandbox/CI policies blocking mkdir in temp paths; antivirus or security software deleting temp content; extremely long TMPDIR paths on Windows.
Understand the failure class
Background: mkdir permission denied (EACCES): failed to create directory errors explained — this error's family across 32 libraries.
Related errors
AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22).
Data as JSON: /api/errors/e3d4c95de6d9b528.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tui/src/client.rs:8514
let client = client_with_config_secret_sentinels();
let ordinary = "tests passed: 42\nREADME.md updated\n";
let prepared =
client.prepare_model_bound_request(request_with_tool_result(ordinary.to_string()));
assert_eq!(tool_result_content(&prepared), ordinary);
}
}
/// The `[redaction] model_bound = "disabled"` opt-out, once confirmed on
/// the startup gate, must let the model see tool output byte-for-byte —
/// including configured secrets and credential-shaped values that the
/// default masking would have removed (#5546 keeps code quotable; this
/// opt-out goes further and keeps credentials quotable too).
#[test]
fn confirmed_opt_out_keeps_configured_secrets_visible_to_the_model() {
let _env_lock = crate::test_support::lock_test_env();
let tmp = tempfile::tempdir().expect("tempdir");
let home = tmp.path().join("home");
std::fs::create_dir_all(&home).expect("create isolated home");
let _home = crate::test_support::EnvVarGuard::set("HOME", &home);
let _userprofile = crate::test_support::EnvVarGuard::set("USERPROFILE", &home);
let codewhale_home = tmp.path().join("codewhale-home");
let _codewhale_home =
crate::test_support::EnvVarGuard::set("CODEWHALE_HOME", &codewhale_home);
std::fs::create_dir_all(&codewhale_home).expect("create config home");
std::fs::write(
codewhale_home.join("config.toml"),
"[redaction]\nmodel_bound = \"disabled\"\n",
)
.expect("write opt-out request");
codewhale_config::redaction::record_model_bound_disabled_confirmation(
&codewhale_home.join("config.toml"),
)
.expect("record opt-out confirmation");
let client = CodewhaleClient::new(&Config {
loaded_config_path: Some(codewhale_home.join("config.toml")),View on GitHub (pinned to 73e0f67d83)