feat: harden community production foundation through story 1.5
This commit is contained in:
1 parent
c30461cc92
commit
f6fc2e5c9b
161 files changed
+16758
-2515
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use std::{collections::BTreeSet, sync::Arc};
|
||||
|
||||
use axum::{http::StatusCode, response::Response};
|
||||
use crank_core::{ToolAccessMode, search_tool_catalog};
|
||||
use crank_core::{CorrelationContext, ToolAccessMode, search_tool_catalog};
|
||||
use crank_registry::PublishedAgentCatalog;
|
||||
use crank_trace::{ErrorCategory, Stage, StageOutcome};
|
||||
use serde::Deserialize;
|
||||
@@ -46,8 +46,9 @@ pub(super) async fn handle_catalog_tool_call(
|
||||
catalog: &PublishedAgentCatalog,
|
||||
tool_name: &str,
|
||||
arguments: Value,
|
||||
transport_request_id: &str,
|
||||
transport_correlation: &CorrelationContext,
|
||||
) -> Response {
|
||||
let transport_request_id = transport_correlation.request_id().as_str();
|
||||
match catalog.tool_selection_policy.mode {
|
||||
ToolAccessMode::Direct => {
|
||||
execute_catalog_tool(
|
||||
@@ -59,7 +60,7 @@ pub(super) async fn handle_catalog_tool_call(
|
||||
catalog,
|
||||
tool_name,
|
||||
arguments,
|
||||
transport_request_id,
|
||||
transport_correlation,
|
||||
)
|
||||
.await
|
||||
}
|
||||
@@ -90,6 +91,7 @@ pub(super) async fn handle_catalog_tool_call(
|
||||
proxy.catalog_revision
|
||||
),
|
||||
transport_request_id,
|
||||
transport_correlation.trace_id().as_str(),
|
||||
true,
|
||||
Some(
|
||||
"Повторите search_tools и вызовите инструмент с новой версией каталога.",
|
||||
@@ -106,7 +108,7 @@ pub(super) async fn handle_catalog_tool_call(
|
||||
catalog,
|
||||
&proxy.name,
|
||||
proxy.arguments,
|
||||
transport_request_id,
|
||||
transport_correlation,
|
||||
)
|
||||
.await
|
||||
}
|
||||
@@ -126,7 +128,7 @@ async fn execute_catalog_tool(
|
||||
catalog: &PublishedAgentCatalog,
|
||||
tool_name: &str,
|
||||
mut arguments: Value,
|
||||
transport_request_id: &str,
|
||||
transport_correlation: &CorrelationContext,
|
||||
) -> Response {
|
||||
let resolve_span = Stage::McpToolsResolve.span();
|
||||
let resolved = resolve_span.in_scope(|| resolve_generated_tool(&catalog.tools, tool_name));
|
||||
@@ -158,7 +160,7 @@ async fn execute_catalog_tool(
|
||||
resolved,
|
||||
arguments,
|
||||
confirmation_token,
|
||||
transport_request_id,
|
||||
transport_correlation,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user