{"record":{"id":"97faaec2f3562117","repo":"tinyhumansai/openhuman","slug":"reqwest-client-must-build","errorCode":null,"errorMessage":"reqwest client must build","messagePattern":"reqwest client must build","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/mcp/http_client/client.rs","lineNumber":233,"sourceCode":"        endpoint: String,\n        timeout_secs: u64,\n        auth: McpAuthConfig,\n        identity: McpClientIdentityConfig,\n    ) -> Self {\n        let builder = reqwest::Client::builder()\n            .timeout(Duration::from_secs(timeout_secs))\n            .connect_timeout(Duration::from_secs(10))\n            // Follow a bounded number of redirects so servers published behind a\n            // vanity/short URL that 30x-redirects to their real MCP endpoint\n            // (e.g. `sh.inference.ac` -> `api.inference.sh/mcp`) connect instead\n            // of failing with a raw `MCP HTTP 301`. `Policy::limited` is safe\n            // here: reqwest strips sensitive headers (Authorization, Cookie) on\n            // cross-origin redirects, so a server bearer token is never leaked\n            // to the redirect target.\n            .redirect(reqwest::redirect::Policy::limited(5));\n        let builder =\n            crate::openhuman::config::apply_runtime_proxy_to_builder(builder, \"tool.mcp_client\");\n        let http = builder.build().expect(\"reqwest client must build\");\n        Self {\n            endpoint,\n            http,\n            next_id: AtomicI64::new(1),\n            client_info: McpClientInfo {\n                name: identity.name,\n                title: Some(identity.title),\n                version: identity.version,\n            },\n            auth,\n            state: Mutex::new(SessionState {\n                negotiated_protocol_version: LATEST_PROTOCOL_VERSION.to_string(),\n                ..SessionState::default()\n            }),\n        }\n    }\n\n    pub fn endpoint(&self) -> &str {","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/mcp/http_client/client.rs#L215-L251","documentation":"Panic payload on reqwest::Client::builder().build() in McpHttpClient's constructor: the builder sets overall + connect timeouts and a bounded redirect policy (so vanity-URL MCP servers that 30x to their real endpoint connect). Construction depends only on these static choices, so failure indicates a TLS/proxy environment problem and the expect aborts client creation for that MCP endpoint.","triggerScenarios":"Thrown at src/openhuman/mcp/http_client/client.rs:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check environment proxy variables and their interaction with reqwest's defaults","Verify the TLS features compiled into this build","Propagate the error instead of panicking so one bad endpoint does not take down MCP init"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}