{"record":{"id":"51bdf5ca4ce692c2","repo":"openai/codex","slug":"unable-to-determine-callback-address","errorCode":null,"errorMessage":"unable to determine callback address","messagePattern":"unable to determine callback address","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/perform_oauth_login.rs","lineNumber":438,"sourceCode":"    }\n\n    Ok(None)\n}\n\nfn local_redirect_uri(server: &Server) -> Result<String> {\n    match server.server_addr() {\n        tiny_http::ListenAddr::IP(std::net::SocketAddr::V4(addr)) => {\n            let ip = addr.ip();\n            let port = addr.port();\n            Ok(format!(\"http://{ip}:{port}/callback\"))\n        }\n        tiny_http::ListenAddr::IP(std::net::SocketAddr::V6(addr)) => {\n            let ip = addr.ip();\n            let port = addr.port();\n            Ok(format!(\"http://[{ip}]:{port}/callback\"))\n        }\n        #[cfg(not(target_os = \"windows\"))]\n        _ => Err(anyhow!(\"unable to determine callback address\")),\n    }\n}\n\nfn resolve_redirect_uri(server: &Server, callback_url: Option<&str>) -> Result<String> {\n    let Some(callback_url) = callback_url else {\n        return local_redirect_uri(server);\n    };\n    Url::parse(callback_url)\n        .with_context(|| format!(\"invalid MCP OAuth callback URL `{callback_url}`\"))?;\n    Ok(callback_url.to_string())\n}\n\nfn callback_id_from_server_url(server_url: &str) -> Result<String> {\n    // Native Codex callback IDs intentionally hash the complete MCP URL (minus its fragment)\n    // with SHA-256. Python connector callback IDs use SHAKE-256 over the origin and are distinct.\n    let mut parsed =\n        Url::parse(server_url).with_context(|| format!(\"invalid MCP server URL `{server_url}`\"))?;\n    parsed","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/perform_oauth_login.rs#L420-L456","documentation":"Error \"unable to determine callback address\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/perform_oauth_login.rs:438 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}