Hmbown/CodeWhale · error · anyhow::Error

OpenSandbox returned HTTP {}: {}

Error message

OpenSandbox returned HTTP {}: {}

What it means

OpenSandbox exec transport: the HTTP call to the sandbox run endpoint completed but returned a non-success status. The response body is fetched and embedded (possibly empty if unreadable), so the remote sandbox's own error text is surfaced to the caller.

Source

Thrown at crates/tui/src/sandbox/opensandbox.rs:98

            cmd: cmd.to_string(),
            env: env.clone(),
        };

        let mut req = self.client.post(self.run_url()).json(&request_body);

        if let Some(ref api_key) = self.api_key {
            req = req.bearer_auth(api_key);
        }

        let response = req
            .send()
            .await
            .context("Failed to reach OpenSandbox endpoint")?;

        let status = response.status();
        if !status.is_success() {
            let body = response.text().await.unwrap_or_default();
            anyhow::bail!("OpenSandbox returned HTTP {}: {}", status.as_u16(), body);
        }

        let parsed: SandboxRunResponse = response
            .json()
            .await
            .context("Failed to parse OpenSandbox response")?;

        Ok(SandboxOutput {
            stdout: parsed.stdout,
            stderr: parsed.stderr,
            exit_code: parsed.exit_code,
        })
    }
}

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Read the status and body text for the sandbox's error
  2. Check API key and endpoint configuration
  3. Retry once transient server issues are ruled out
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/tui/src/sandbox/opensandbox.rs:98 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/03a973cb1b624470. Report an issue: GitHub.