Planner Autonomy: скрыть внутренние MCP-ошибки в checked-source ответах

This commit is contained in:
2026-05-01 17:46:54 +03:00
parent f6846206ad
commit 472d982486
9 changed files with 101 additions and 12 deletions
@@ -35,7 +35,12 @@ function formatNamedChoiceList(values) {
}
function isInternalMechanicsLine(value) {
const text = value.toLowerCase();
return (text.includes("primitive") ||
return (text.includes("mcp fetch failed") ||
text.includes("this operation was aborted") ||
text.includes("entity-resolution") ||
text.includes("could not continue") ||
text.includes("checked catalog search step") ||
text.includes("primitive") ||
text.includes("query_documents") ||
text.includes("query_movements") ||
text.includes("resolve_entity_reference") ||
@@ -50,6 +55,12 @@ function isInternalMechanicsLine(value) {
text.includes("needs more scope before execution") ||
text.includes("mcp_execution_performed"));
}
function isMcpTransportFailureLine(value) {
const text = value.toLowerCase();
return (text.includes("mcp fetch failed") ||
text.includes("this operation was aborted") ||
text.includes("operation was aborted"));
}
function userFacingUnknowns(values) {
return uniqueStrings(values).filter((value) => !isInternalMechanicsLine(value));
}
@@ -62,7 +73,20 @@ function rankedValueFlowUnknownLines(pilot) {
return [`Полный рейтинг контрагентов вне ${period} этим поиском не подтвержден.`];
}
function userFacingLimitations(values) {
return uniqueStrings(values).filter((value) => !isInternalMechanicsLine(value));
const result = [];
for (const value of uniqueStrings(values)) {
if (isMcpTransportFailureLine(value)) {
const line = "Доступ к 1С во время проверки оборвался; подтвержденные строки не получены.";
if (!result.includes(line)) {
result.push(line);
}
continue;
}
if (!isInternalMechanicsLine(value)) {
result.push(value);
}
}
return result;
}
function modeFor(pilot) {
if (pilot.pilot_status === "blocked") {
@@ -452,7 +476,7 @@ function nextStepFor(mode, pilot) {
}
}
if (mode === "checked_sources_only" && pilot.query_limitations.length > 0) {
return "Можно повторить проверку после восстановления MCP-доступа или сузить вопрос до конкретного контрагента/периода.";
return "Можно повторить проверку после восстановления доступа к 1С или сузить вопрос до конкретного контрагента/периода.";
}
if (mode === "blocked") {
return "Нужно сначала снять policy/blocking причину, иначе данные 1С использовать нельзя.";
@@ -48,7 +48,12 @@ function uniqueStrings(values) {
}
function hasInternalMechanics(value) {
const text = value.toLowerCase();
return (text.includes("query_documents") ||
return (text.includes("mcp fetch failed") ||
text.includes("this operation was aborted") ||
text.includes("entity-resolution") ||
text.includes("could not continue") ||
text.includes("checked catalog search step") ||
text.includes("query_documents") ||
text.includes("query_movements") ||
text.includes("primitive") ||
text.includes("pilot_") ||
@@ -38,7 +38,12 @@ function pushReason(target, value) {
}
function hasInternalMechanics(value) {
const text = value.toLowerCase();
return (text.includes("query_documents") ||
return (text.includes("mcp fetch failed") ||
text.includes("this operation was aborted") ||
text.includes("entity-resolution") ||
text.includes("could not continue") ||
text.includes("checked catalog search step") ||
text.includes("query_documents") ||
text.includes("query_movements") ||
text.includes("primitive") ||
text.includes("pilot_") ||