feat: complete Epic 1 production foundation

This commit is contained in:
bsodfather committed 2026-08-25 01:24:11 +03:00
1 parent 767428436d
commit 182bde8ac0
298 files changed
+35711 -5291

No files matched your search

+12 -11
View File
@@ -22,7 +22,7 @@ use super::{
observe_invocation_history_outcome, tool_error_response,
};
use crate::jsonrpc::{CURRENT_PROTOCOL_VERSION, jsonrpc_error};
use crate::tool_error::generic_tool_error_contract;
use crate::tool_error::{McpControlError, control_tool_error_contract};
use crate::transport::transport_response;
#[tokio::test]
@@ -33,13 +33,11 @@ async fn tool_error_response_includes_structured_context() {
&message,
ResponseMode::Json,
CURRENT_PROTOCOL_VERSION,
generic_tool_error_contract(
"streaming_payload_error",
"request root must be an object",
control_tool_error_contract(
McpControlError::CatalogRevisionChanged,
"req-1",
"0af7651916cd43dd8448eb211c80319c",
false,
Some("Проверьте параметры вызова инструмента."),
crank_core::ExecutionLocale::Ru,
),
);
assert_eq!(
@@ -55,13 +53,16 @@ async fn tool_error_response_includes_structured_context() {
assert_eq!(
payload["result"]["structuredContent"]["error"],
json!({
"code": "streaming_payload_error",
"error_code": "streaming_payload_error",
"message": "request root must be an object",
"recoverable": false,
"code": "agent_catalog_result_stale",
"error_code": "agent_catalog_result_stale",
"message": "Версия каталога изменилась.",
"stage": "authorization",
"retryability": "after_delay",
"outcome_certainty": "certain",
"recoverable": true,
"request_id": "req-1",
"trace_id": "0af7651916cd43dd8448eb211c80319c",
"suggested_action": "Проверьте параметры вызова инструмента."
"suggested_action": "Повторите search_tools и вызовите инструмент с новой версией каталога."
})
);
}