tinyhumansai/openhuman · error · anyhow::Error

[claude_agent_sdk] subprocess timed out while waiting for…

Error message

[claude_agent_sdk] subprocess timed out while waiting for exit

What it means

The claude_agent_sdk subprocess did not exit within the 30-second wait timeout after output reading completed — the process is hung. The sibling read path kills the child on timeout; this site surfaces the hang as an error so the caller's turn fails fast instead of blocking the task indefinitely.

Solutions

  1. Treat the turn as failed and retry
  2. Check for a stuck claude subprocess and kill it
  3. Investigate CLI hangs (interactive prompt, blocked I/O) if recurrent
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs:221 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/d52273ba3e451d9e. Report an issue: GitHub.

Appendix: source

Thrown at src/openhuman/inference/provider/claude_agent_sdk/subprocess.rs:221

                    }
                }
            }
            anyhow::Ok(())
        })
        .await;

        match read_result {
            Ok(inner) => inner?,
            Err(_) => {
                let _ = child.kill().await;
                anyhow::bail!("[claude_agent_sdk] subprocess timed out while reading output");
            }
        }

        let status = timeout(Duration::from_secs(30), child.wait())
            .await
            .map_err(|_| {
                anyhow::anyhow!("[claude_agent_sdk] subprocess timed out while waiting for exit")
            })??;
        let stderr_output = stderr_task.await.unwrap_or_default();
        tracing::debug!("[claude_agent_sdk] subprocess exited status={}", status);

        if let Some(err) = error_message {
            anyhow::bail!("[claude_agent_sdk] error from claude CLI: {err}");
        }

        // Use the final result message if present; otherwise join streaming text parts.
        let output = result_text
            .filter(|s| !s.is_empty())
            .unwrap_or_else(|| text_parts.join(""));

        if !status.success() && output.is_empty() {
            anyhow::bail!(
                "[claude_agent_sdk] claude subprocess exited with non-zero status {} and no output; stderr={}",
                status,
                stderr_output

View on GitHub (pinned to 7491200858)