Удержать контекст СВК в follow-up ассистента

This commit is contained in:
2026-06-15 22:56:10 +03:00
parent 7e70ec1d46
commit b3f2e405bb
23 changed files with 950 additions and 91 deletions
@@ -1313,6 +1313,15 @@ function mergeFollowupFilters(current, intent, userMessage, followupContext) {
intent === "vat_payable_confirmed_as_of_date";
const currentHasPeriod = hasExplicitPeriodWindow(merged);
const previousHasPeriod = hasExplicitPeriodWindow(previous);
const currentPeriodFromForCarryover = toNonEmptyString(merged.period_from);
const currentPeriodToForCarryover = toNonEmptyString(merged.period_to);
const todayIsoForPeriodCarryover = new Date().toISOString().slice(0, 10);
const currentValueFlowPeriodDefaultsToToday = isValueCounterpartyIntent(intent) &&
hasFollowupSignal &&
!hasExplicitPeriodInMessage &&
!hasExplicitCurrentDateInMessage &&
!currentPeriodFromForCarryover &&
currentPeriodToForCarryover === todayIsoForPeriodCarryover;
const currentCounterpartyExplicit = toNonEmptyString(merged.counterparty);
const currentContractExplicit = toNonEmptyString(merged.contract);
const currentItemExplicit = toNonEmptyString(merged.item);
@@ -1387,7 +1396,7 @@ function mergeFollowupFilters(current, intent, userMessage, followupContext) {
}
reasons.push("period_from_followup_context");
}
if (!currentHasPeriod &&
if ((!currentHasPeriod || currentValueFlowPeriodDefaultsToToday) &&
previousHasPeriod &&
hasFollowupSignal &&
!hasExplicitPeriodInMessage &&