tinyhumansai/openhuman · error · anyhow::Error
claude child stderr missing
Error message
claude child stderr missing
What it means
Taking the piped stderr handle from the spawned claude child returned None. Same guard shape as the stdout one: stderr was requested piped, so None means the configuration was lost or the handle already consumed — an invariant failure rather than an IO error.
Source
Thrown at src/openhuman/inference/provider/claude_code/driver.rs:410
if let Some(mut stdin) = child.stdin.take() {
stdin
.write_all(&stdin_bytes)
.await
.map_err(|e| anyhow::anyhow!("write stdin: {e}"))?;
stdin
.shutdown()
.await
.map_err(|e| anyhow::anyhow!("close stdin: {e}"))?;
}
let mut stdout = child
.stdout
.take()
.ok_or_else(|| anyhow::anyhow!("claude child stdout missing"))?;
let mut stderr = child
.stderr
.take()
.ok_or_else(|| anyhow::anyhow!("claude child stderr missing"))?;
let mut parser = StreamJsonParser::new();
let mut mapper = EventMapper::new();
let mut buf = [0u8; 8192];
// Drain stderr in parallel into a buffer for diagnostics.
let stderr_task = tokio::spawn(async move {
let mut acc = String::new();
let mut tmp = [0u8; 4096];
while let Ok(n) = stderr.read(&mut tmp).await {
if n == 0 {
break;
}
acc.push_str(&String::from_utf8_lossy(&tmp[..n]));
if acc.len() > 16_384 {
acc.truncate(16_384);
}
}View on GitHub (pinned to 7491200858)
Solutions
- Ensure stderr is configured as Stdio::piped when spawning
- Audit for any code taking the handle before the driver
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at src/openhuman/inference/provider/claude_code/driver.rs:410 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17).
Data as JSON: /api/errors/9ce3a39a1bd76ee9.
Report an issue: GitHub.