{"record":{"id":"b7abb38c29cd82e3","repo":"tinyhumansai/openhuman","slug":"create-scratch-dir-e","errorCode":null,"errorMessage":"create scratch dir: {e}","messagePattern":"create scratch dir: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/inference/provider/claude_code/driver.rs","lineNumber":251,"sourceCode":"        let id = generate_uuid_v4();\n        if let Err(e) = ctx.session_store.set(&ctx.thread_id, &id) {\n            log::warn!(\n                \"[claude-code][driver] failed to persist session uuid for thread {}: {}\",\n                ctx.thread_id,\n                e\n            );\n        }\n        id\n    } else {\n        stored.expect(\"checked Some above\")\n    };\n\n    // Set up a per-turn scratch dir for --mcp-config and any other transient\n    // state. Best-effort cleanup at end of turn.\n    let scratch = tempfile::Builder::new()\n        .prefix(\"openhuman-cc-\")\n        .tempdir()\n        .map_err(|e| anyhow::anyhow!(\"create scratch dir: {e}\"))?;\n    // Point CC at OpenHuman's in-process HTTP MCP server (unjailed core), so\n    // the memory bridge survives CC's `.openhuman` jail deny.\n    let mut mcp_config_path: Option<PathBuf> = None;\n    match crate::openhuman::mcp::server::ensure_local_http().await {\n        Ok(endpoint) => match write_mcp_http_config(scratch.path(), endpoint.addr, &endpoint.token) {\n            Ok(p) => {\n                log::debug!(\n                    \"[claude-code][driver] wrote http mcp-config path={} url=http://{}/ (authenticated)\",\n                    p.display(),\n                    endpoint.addr\n                );\n                mcp_config_path = Some(p);\n            }\n            Err(e) => log::warn!(\n                \"[claude-code][driver] failed to write mcp-config: {e}; CC will run without OpenHuman MCP tools\"\n            ),\n        },\n        Err(e) => log::warn!(","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/inference/provider/claude_code/driver.rs#L233-L269","documentation":"Creating the per-turn temp directory (openhuman-cc- prefix) that holds --mcp-config and other transient Claude Code state failed. A tempfile/IO failure at turn setup — nothing has been spawned yet, and best-effort cleanup semantics mean the error is about disk/tmp permissions or space.","triggerScenarios":"Thrown at src/openhuman/inference/provider/claude_code/driver.rs:251 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check TMPDIR writability and free space","Retry the turn; transient tempfile creation failures clear"],"exampleFix":null,"handlingStrategy":"try-catch","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"}