diff --git a/crates/contextforge-data-plane-lib/src/gateway/identifier_routing.rs b/crates/contextforge-data-plane-lib/src/gateway/identifier_routing.rs index e2be6f00..b5e8b472 100644 --- a/crates/contextforge-data-plane-lib/src/gateway/identifier_routing.rs +++ b/crates/contextforge-data-plane-lib/src/gateway/identifier_routing.rs @@ -1,13 +1,14 @@ use contextforge_data_plane_apis::user_store::{BackendMCPGateway, NameAlias, VirtualHost}; use rmcp::{ErrorData, model::ErrorCode, service::ServiceError}; -use tracing::warn; +use tracing::{debug, warn}; -fn resolve_route<'a, N: AsRef>( +fn resolve_route<'a, N: AsRef + std::fmt::Debug>( virtual_host: &'a VirtualHost, name: &'a str, backend_names: &'a [N], name_extractor: impl Fn(&'a str, &'a BackendMCPGateway) -> Option<&'a str>, ) -> Result, Box> { + debug!("resolve_route: vh {virtual_host:#?}, name {name}, backend_names {backend_names:?}"); let mut aliases = backend_names.iter().filter_map(|backend_name| { let backend_name = backend_name.as_ref(); let backend = virtual_host.backends.get(backend_name)?; @@ -23,7 +24,7 @@ fn resolve_route<'a, N: AsRef>( /// Resolves an exact control-plane alias to its backend and upstream name. Without an alias, /// single-backend hosts preserve the upstream name and multi-backend hosts use the legacy prefix. -pub(crate) fn resolve_tool_route<'a, N: AsRef>( +pub(crate) fn resolve_tool_route<'a, N: AsRef + std::fmt::Debug>( virtual_host: &'a VirtualHost, name: &'a str, backend_names: &'a [N], @@ -36,7 +37,7 @@ pub(crate) fn resolve_tool_route<'a, N: AsRef>( }) } -pub(super) fn resolve_resources_route<'a, N: AsRef>( +pub(super) fn resolve_resources_route<'a, N: AsRef + std::fmt::Debug>( virtual_host: &'a VirtualHost, name: &'a str, backend_names: &'a [N], @@ -49,7 +50,7 @@ pub(super) fn resolve_resources_route<'a, N: AsRef>( }) } -pub(super) fn resolve_prompt_route<'a, N: AsRef>( +pub(super) fn resolve_prompt_route<'a, N: AsRef + std::fmt::Debug>( virtual_host: &'a VirtualHost, name: &'a str, backend_names: &'a [N], diff --git a/crates/contextforge-data-plane-lib/src/gateway/mcp_service.rs b/crates/contextforge-data-plane-lib/src/gateway/mcp_service/mod.rs similarity index 99% rename from crates/contextforge-data-plane-lib/src/gateway/mcp_service.rs rename to crates/contextforge-data-plane-lib/src/gateway/mcp_service/mod.rs index bc92e203..501bbccd 100644 --- a/crates/contextforge-data-plane-lib/src/gateway/mcp_service.rs +++ b/crates/contextforge-data-plane-lib/src/gateway/mcp_service/mod.rs @@ -3,7 +3,6 @@ mod initialization; mod prompts; mod resources; mod tools; - use contextforge_data_plane_cpex::GatewayPluginRuntimeHandle; use rmcp::{ ErrorData, RoleServer, ServerHandler, diff --git a/crates/contextforge-data-plane-lib/src/gateway/mcp_service/prompts.rs b/crates/contextforge-data-plane-lib/src/gateway/mcp_service/prompts.rs index f3b208d1..9e7219fb 100644 --- a/crates/contextforge-data-plane-lib/src/gateway/mcp_service/prompts.rs +++ b/crates/contextforge-data-plane-lib/src/gateway/mcp_service/prompts.rs @@ -30,7 +30,7 @@ pub(super) async fn get_prompt( else { return Err(ErrorData { code: ErrorCode::INVALID_PARAMS, - message: "Routing problem... promtp not found".into(), + message: "Routing problem... prompt not found".into(), data: None, }); };