{"record":{"id":"e3d4c95de6d9b528","repo":"Hmbown/CodeWhale","slug":"create-isolated-home","errorCode":null,"errorMessage":"create isolated home","messagePattern":"create isolated home","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/client.rs","lineNumber":8514,"sourceCode":"            let client = client_with_config_secret_sentinels();\n            let ordinary = \"tests passed: 42\\nREADME.md updated\\n\";\n            let prepared =\n                client.prepare_model_bound_request(request_with_tool_result(ordinary.to_string()));\n            assert_eq!(tool_result_content(&prepared), ordinary);\n        }\n    }\n\n    /// The `[redaction] model_bound = \"disabled\"` opt-out, once confirmed on\n    /// the startup gate, must let the model see tool output byte-for-byte —\n    /// including configured secrets and credential-shaped values that the\n    /// default masking would have removed (#5546 keeps code quotable; this\n    /// opt-out goes further and keeps credentials quotable too).\n    #[test]\n    fn confirmed_opt_out_keeps_configured_secrets_visible_to_the_model() {\n        let _env_lock = crate::test_support::lock_test_env();\n        let tmp = tempfile::tempdir().expect(\"tempdir\");\n        let home = tmp.path().join(\"home\");\n        std::fs::create_dir_all(&home).expect(\"create isolated home\");\n        let _home = crate::test_support::EnvVarGuard::set(\"HOME\", &home);\n        let _userprofile = crate::test_support::EnvVarGuard::set(\"USERPROFILE\", &home);\n        let codewhale_home = tmp.path().join(\"codewhale-home\");\n        let _codewhale_home =\n            crate::test_support::EnvVarGuard::set(\"CODEWHALE_HOME\", &codewhale_home);\n        std::fs::create_dir_all(&codewhale_home).expect(\"create config home\");\n        std::fs::write(\n            codewhale_home.join(\"config.toml\"),\n            \"[redaction]\\nmodel_bound = \\\"disabled\\\"\\n\",\n        )\n        .expect(\"write opt-out request\");\n        codewhale_config::redaction::record_model_bound_disabled_confirmation(\n            &codewhale_home.join(\"config.toml\"),\n        )\n        .expect(\"record opt-out confirmation\");\n\n        let client = CodewhaleClient::new(&Config {\n            loaded_config_path: Some(codewhale_home.join(\"config.toml\")),","sourceCodeStart":8496,"sourceCodeEnd":8532,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L8496-L8532","documentation":"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.","triggerScenarios":"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.","commonSituations":"Overly restrictive sandbox/CI policies blocking mkdir in temp paths; antivirus or security software deleting temp content; extremely long TMPDIR paths on Windows.","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"],"exampleFix":"// before\nstd::fs::create_dir_all(&home).expect(\"create isolated home\");\n// after\nstd::fs::create_dir_all(&home).expect(\"create isolated home: check tempdir permissions and path length\");","handlingStrategy":"validation","validationCode":"assert!(fs::create_dir_all(&home).is_ok(), \"cannot create isolated home under {}\", tmp.path().display());","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["rust","filesystem","mkdir","test-infrastructure"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T11:17:16.035Z"}