Planner Autonomy: скрыть внутренние MCP-ошибки в checked-source ответах
This commit is contained in:
@@ -62,6 +62,11 @@ function formatNamedChoiceList(values: string[]): string {
|
||||
function isInternalMechanicsLine(value: string): boolean {
|
||||
const text = value.toLowerCase();
|
||||
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") ||
|
||||
@@ -79,6 +84,15 @@ function isInternalMechanicsLine(value: string): boolean {
|
||||
);
|
||||
}
|
||||
|
||||
function isMcpTransportFailureLine(value: string): boolean {
|
||||
const text = value.toLowerCase();
|
||||
return (
|
||||
text.includes("mcp fetch failed") ||
|
||||
text.includes("this operation was aborted") ||
|
||||
text.includes("operation was aborted")
|
||||
);
|
||||
}
|
||||
|
||||
function userFacingUnknowns(values: string[]): string[] {
|
||||
return uniqueStrings(values).filter((value) => !isInternalMechanicsLine(value));
|
||||
}
|
||||
@@ -93,7 +107,20 @@ function rankedValueFlowUnknownLines(pilot: AssistantMcpDiscoveryPilotExecutionC
|
||||
}
|
||||
|
||||
function userFacingLimitations(values: string[]): string[] {
|
||||
return uniqueStrings(values).filter((value) => !isInternalMechanicsLine(value));
|
||||
const result: string[] = [];
|
||||
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: AssistantMcpDiscoveryPilotExecutionContract): AssistantMcpDiscoveryAnswerMode {
|
||||
@@ -554,7 +581,7 @@ function nextStepFor(mode: AssistantMcpDiscoveryAnswerMode, pilot: AssistantMcpD
|
||||
}
|
||||
}
|
||||
if (mode === "checked_sources_only" && pilot.query_limitations.length > 0) {
|
||||
return "Можно повторить проверку после восстановления MCP-доступа или сузить вопрос до конкретного контрагента/периода.";
|
||||
return "Можно повторить проверку после восстановления доступа к 1С или сузить вопрос до конкретного контрагента/периода.";
|
||||
}
|
||||
if (mode === "blocked") {
|
||||
return "Нужно сначала снять policy/blocking причину, иначе данные 1С использовать нельзя.";
|
||||
|
||||
@@ -75,6 +75,11 @@ function uniqueStrings(values: string[]): string[] {
|
||||
function hasInternalMechanics(value: string): boolean {
|
||||
const text = value.toLowerCase();
|
||||
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") ||
|
||||
|
||||
@@ -71,6 +71,11 @@ function pushReason(target: string[], value: string): void {
|
||||
function hasInternalMechanics(value: string): boolean {
|
||||
const text = value.toLowerCase();
|
||||
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") ||
|
||||
|
||||
Reference in New Issue
Block a user