{"record":{"id":"33e203ef1d4451c0","repo":"tinyhumansai/openhuman","slug":"read-stdout-e","errorCode":null,"errorMessage":"read stdout: {e}","messagePattern":"read stdout: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/inference/provider/claude_code/driver.rs","lineNumber":439,"sourceCode":"            if n == 0 {\n                break;\n            }\n            acc.push_str(&String::from_utf8_lossy(&tmp[..n]));\n            if acc.len() > 16_384 {\n                acc.truncate(16_384);\n            }\n        }\n        acc\n    });\n\n    // Wrap the streaming + wait in a timeout so a stuck CLI doesn't\n    // block this task forever (PLAN §8).\n    let timed = tokio::time::timeout(TURN_TIMEOUT, async {\n        loop {\n            let n = stdout\n                .read(&mut buf)\n                .await\n                .map_err(|e| anyhow::anyhow!(\"read stdout: {e}\"))?;\n            if n == 0 {\n                break;\n            }\n            for ev in parser.feed_bytes(&buf[..n]) {\n                for delta in mapper.handle(ev) {\n                    if let Some(tx) = ctx.stream {\n                        let _ = tx.send(delta).await;\n                    }\n                }\n            }\n        }\n        for ev in parser.end() {\n            for delta in mapper.handle(ev) {\n                if let Some(tx) = ctx.stream {\n                    let _ = tx.send(delta).await;\n                }\n            }\n        }","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/inference/provider/claude_code/driver.rs#L421-L457","documentation":"Reading from the claude child's stdout inside the TURN_TIMEOUT-bounded loop failed — the pipe errored (child died, descriptor closed). The timeout wrapper exists so a stuck CLI cannot block forever; this error is the read failing, not the timeout firing.","triggerScenarios":"Thrown at src/openhuman/inference/provider/claude_code/driver.rs:439 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check stderr captured alongside for the child's failure cause","Retry the turn; abrupt child exits are often transient","Update the claude CLI if crashes reproduce"],"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"}