Hmbown/CodeWhale · error · anyhow::Error

Runtime API server error: {e}

Error message

Runtime API server error: {e}

What it means

The axum Runtime API server's serve() future returned an error after startup — listener/accept or IO-level failure during serving, not a request-handling error.

Source

Thrown at crates/tui/src/runtime_api.rs:976

        );
        if !auth_enabled {
            println!(
                "  WARNING: auth is disabled. Anyone on the network can call /v1/* without authentication."
            );
        }
        println!(
            "  /v1/runtime/info reports bind_host={host:?}, port={port}, auth_required={auth}.",
            host = options.host,
            port = options.port,
            auth = auth_enabled,
        );
    }
    let serve_result = axum::serve(
        listener,
        app.into_make_service_with_connect_info::<SocketAddr>(),
    )
    .await
    .map_err(|e| anyhow!("Runtime API server error: {e}"));
    scheduler_cancel.cancel();
    scheduler_handle.abort();
    serve_result
}

fn web_launcher_warning(result: Result<()>) -> Option<String> {
    result.err().map(|error| {
        format!(
            "warning: could not open the default browser ({error}); open the bootstrap URL above manually"
        )
    })
}

fn fallback_sessions_dir() -> PathBuf {
    if let Some(home) = codewhale_paths::codewhale_home_override().ok().flatten() {
        return home.join("sessions");
    }
    codewhale_paths::legacy_deepseek_home()

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Check whether the port is still free or the socket was closed unexpectedly
  2. Inspect system logs for resource or network issues
  3. Restart the Runtime API server
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/tui/src/runtime_api.rs:976 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/590671b7aabb8015. Report an issue: GitHub.