{"record":{"id":"09b1dc180be97a14","repo":"tinyhumansai/openhuman","slug":"invalid-paramname-value-must-be-a-valid","errorCode":null,"errorMessage":"Invalid ${paramName}: '${value}'. Must be a valid integer ID or a username string.","messagePattern":"Invalid (.+?): '(.+?)'\\. Must be a valid integer ID or a username string\\.","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"critical","filePath":"app/src/lib/mcp/validation.ts","lineNumber":41,"sourceCode":"    return value;\n  }\n\n  if (typeof value === 'string') {\n    const intValue = Number.parseInt(value, 10);\n    if (!Number.isNaN(intValue) && Number.isFinite(intValue)) {\n      if (intValue < -(2 ** 63) || intValue > 2 ** 63 - 1) {\n        throw new ValidationError(\n          `Invalid ${paramName}: ${value}. ID is out of the valid integer range.`\n        );\n      }\n      return intValue;\n    }\n\n    if (/^@?[a-zA-Z0-9_]{5,}$/.test(value)) {\n      return value.startsWith('@') ? value : `@${value}`;\n    }\n\n    throw new ValidationError(\n      `Invalid ${paramName}: '${value}'. Must be a valid integer ID or a username string.`\n    );\n  }\n\n  throw new ValidationError(\n    `Invalid ${paramName}: ${String(value)}. Type must be an integer or a string.`\n  );\n}\n\n/**\n * Validate list of IDs\n */\nexport function validateIdList(value: unknown, paramName: string): Array<number | string> {\n  if (!Array.isArray(value)) {\n    throw new ValidationError(`Invalid ${paramName}: must be an array of IDs.`);\n  }\n\n  return value.map((item: unknown, index: number) => {","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/app/src/lib/mcp/validation.ts#L23-L59","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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)","Or stop requesting the transport: build the ServiceSet without rpc_http so runtime matches compile-time surface","For embeddable code, gate the request on the feature: only set rpc_http when `cfg!(feature = \"http-server\")`","Add a CI smoke test that boots the exact shipped feature set with the intended ServiceSet"],"exampleFix":"// before\nlet services = ServiceSet::rpc_http(); // panics-free but bails in slim builds\nlet core = CoreBuilder::new(host).services(services).run().await?;\n\n// after\nlet mut services = ServiceSet::none();\n#[cfg(feature = \"http-server\")]\nservices.rpc_http = true; // only request what this build compiled\nlet core = CoreBuilder::new(host).services(services).run().await?;","handlingStrategy":"validation","validationCode":"// Rust embedding: assert the build can serve before constructing the builder\nfn assert_rpc_http_available() -> Result<(), anyhow::Error> {\n    if !cfg!(feature = \"http-server\") {\n        anyhow::bail!(\"this binary lacks the http-server feature; rebuild with --features http-server or drop ServiceSet::rpc_http\");\n    }\n    Ok(())\n}\n// call before CoreBuilder::new(..).services(ServiceSet::rpc_http())","typeGuard":"fn has_http_server() -> bool { cfg!(feature = \"http-server\") }","tryCatchPattern":"// Rust: catch the startup bail and surface a build fact, not a crash\nmatch core_builder.run().await {\n    Err(e) if e.to_string().contains(\"compiled without the `http-server` feature\") => {\n        eprintln!(\"build/runtime mismatch: add http-server to the feature list or remove rpc_http from ServiceSet\");\n        std::process::exit(78); // EX_CONFIG\n    }\n    other => other,\n}","preventionTips":["Keep ONE source of truth for the feature list (e.g. scripts/ci/product-features.txt) and generate build commands from it","Smoke-test slim builds with the exact ServiceSet you intend to run","Gate ServiceSet members on cfg!(feature = ...) in embedding code so runtime can never request a compiled-out transport"],"tags":["build","cargo-features","configuration","rpc","embedding","startup"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}