{"record":{"id":"94e60ca1c66d5e54","repo":"tinyhumansai/openhuman","slug":"write-stdin-e","errorCode":null,"errorMessage":"write stdin: {e}","messagePattern":"write stdin: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/inference/provider/claude_code/driver.rs","lineNumber":396,"sourceCode":"    let mut cmd = Command::new(&program);\n    cmd.args(&final_args)\n        .current_dir(&ctx.project_dir)\n        .stdin(Stdio::piped())\n        .stdout(Stdio::piped())\n        .stderr(Stdio::piped())\n        .kill_on_drop(true);\n    if let Some(key) = &ctx.anthropic_api_key {\n        cmd.env(\"ANTHROPIC_API_KEY\", key);\n    }\n\n    let mut child = cmd\n        .spawn()\n        .map_err(|e| anyhow::anyhow!(\"failed to spawn `claude`: {e}\"))?;\n    if let Some(mut stdin) = child.stdin.take() {\n        stdin\n            .write_all(&stdin_bytes)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"write stdin: {e}\"))?;\n        stdin\n            .shutdown()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"close stdin: {e}\"))?;\n    }\n\n    let mut stdout = child\n        .stdout\n        .take()\n        .ok_or_else(|| anyhow::anyhow!(\"claude child stdout missing\"))?;\n    let mut stderr = child\n        .stderr\n        .take()\n        .ok_or_else(|| anyhow::anyhow!(\"claude child stderr missing\"))?;\n\n    let mut parser = StreamJsonParser::new();\n    let mut mapper = EventMapper::new();\n    let mut buf = [0u8; 8192];","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/inference/provider/claude_code/driver.rs#L378-L414","documentation":"Writing the turn prompt bytes to the spawned claude process's stdin failed — the pipe broke, typically because the child exited early. Distinct from a spawn failure: the process exists but is not accepting input.","triggerScenarios":"Thrown at src/openhuman/inference/provider/claude_code/driver.rs:396 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the child's stderr for early-exit cause","Retry the turn","Verify the claude CLI version accepts the invocation"],"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"}