tinyhumansai/openhuman · critical · ValidationError

Invalid ${paramName}: '${value}'. Must be a valid integer ID

Error message

Invalid ${paramName}: '${value}'. Must be a valid integer ID or a username string.

What it means

Fail-fast build/runtime mismatch guard in `CoreBuilder::serve` (src/core/runtime/builder.rs:611). The caller's ServiceSet requested the `rpc_http` transport, but this binary was compiled without the `http-server` Cargo feature (which provides axum + socketioxide), so `serve_http` does not exist. The builder refuses to 'serve nothing silently' and bails; the bind inputs (ready_tx, port, host, token) are deliberately touched so they don't read as dead fields in the slim build.

Source

Thrown at app/src/lib/mcp/validation.ts:41

    return value;
  }

  if (typeof value === 'string') {
    const intValue = Number.parseInt(value, 10);
    if (!Number.isNaN(intValue) && Number.isFinite(intValue)) {
      if (intValue < -(2 ** 63) || intValue > 2 ** 63 - 1) {
        throw new ValidationError(
          `Invalid ${paramName}: ${value}. ID is out of the valid integer range.`
        );
      }
      return intValue;
    }

    if (/^@?[a-zA-Z0-9_]{5,}$/.test(value)) {
      return value.startsWith('@') ? value : `@${value}`;
    }

    throw new ValidationError(
      `Invalid ${paramName}: '${value}'. Must be a valid integer ID or a username string.`
    );
  }

  throw new ValidationError(
    `Invalid ${paramName}: ${String(value)}. Type must be an integer or a string.`
  );
}

/**
 * Validate list of IDs
 */
export function validateIdList(value: unknown, paramName: string): Array<number | string> {
  if (!Array.isArray(value)) {
    throw new ValidationError(`Invalid ${paramName}: must be an array of IDs.`);
  }

  return value.map((item: unknown, index: number) => {

View on GitHub (pinned to a221052e0d)

Solutions

  1. Rebuild with the feature: add `http-server` to the feature list, e.g. `cargo build --features http-server` (it is in scripts/ci/product-features.txt for the product build)
  2. Or stop requesting the transport: build the ServiceSet without rpc_http so runtime matches compile-time surface
  3. For embeddable code, gate the request on the feature: only set rpc_http when `cfg!(feature = "http-server")`
  4. Add a CI smoke test that boots the exact shipped feature set with the intended ServiceSet

Example fix

// before
let services = ServiceSet::rpc_http(); // panics-free but bails in slim builds
let core = CoreBuilder::new(host).services(services).run().await?;

// after
let mut services = ServiceSet::none();
#[cfg(feature = "http-server")]
services.rpc_http = true; // only request what this build compiled
let core = CoreBuilder::new(host).services(services).run().await?;
Defensive patterns

Strategy: validation

Validate before calling

// Rust embedding: assert the build can serve before constructing the builder
fn assert_rpc_http_available() -> Result<(), anyhow::Error> {
    if !cfg!(feature = "http-server") {
        anyhow::bail!("this binary lacks the http-server feature; rebuild with --features http-server or drop ServiceSet::rpc_http");
    }
    Ok(())
}
// call before CoreBuilder::new(..).services(ServiceSet::rpc_http())

Type guard

fn has_http_server() -> bool { cfg!(feature = "http-server") }

Try / catch

// Rust: catch the startup bail and surface a build fact, not a crash
match core_builder.run().await {
    Err(e) if e.to_string().contains("compiled without the `http-server` feature") => {
        eprintln!("build/runtime mismatch: add http-server to the feature list or remove rpc_http from ServiceSet");
        std::process::exit(78); // EX_CONFIG
    }
    other => other,
}

Prevention

When it happens

Trigger: An embedding sets `.services(ServiceSet::rpc_http)` (or a preset containing it) in a `--no-default-features` slim/kernel-profile build; a docker image built from a trimmed feature list where `http-server` was dropped but the entrypoint still enables the HTTP RPC listener; CI lanes building explicit feature lists that forgot the gate.

Common situations: Custom embeds modeled on examples/embed_kernel.rs that then flip rpc_http on; slim-profile builds (`--no-default-features --features "<explicit gates>"`) where http-server was omitted; upgrading a build script that previously relied on the default feature set.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/09b1dc180be97a14. Report an issue: GitHub.