From 3790f26082365e8f316db8dcdc97a59f20b90559 Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Wed, 1 Apr 2026 16:55:52 +0800 Subject: [PATCH] =?UTF-8?q?diag+fix:=20=E6=B7=BB=E5=8A=A0recall=E8=AF=8A?= =?UTF-8?q?=E6=96=AD=E6=97=A5=E5=BF=97=20+=20=E4=BF=AE=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=BE=93=E5=85=A5=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 诊断:recall-controller.js 添加图谱/设置/可读性状态日志 修复:buildGenerationAfterCommandsRecallInput 允许normal类型在chat中有用户消息时继续 修复:buildNormalGenerationRecallInput 添加 getLatestUserChatMessage 兜底 --- recall-controller.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/recall-controller.js b/recall-controller.js index 39e63ec..a9199f8 100644 --- a/recall-controller.js +++ b/recall-controller.js @@ -287,10 +287,12 @@ export function applyRecallInjectionController( } export async function runRecallController(runtime, options = {}) { + console.warn("[ST-BME:DIAG:RECALL] runRecallController entered"); if (runtime.getIsRecalling()) { runtime.abortRecallStageWithReason("旧召回已取消,正在启动新的召回"); const settle = await runtime.waitForActiveRecallToSettle(); if (!settle.settled && runtime.getIsRecalling()) { + console.warn("[ST-BME:DIAG:RECALL] EXIT: 上一轮召回仍在清理"); runtime.setLastRecallStatus( "召回忙", "上一轮召回仍在清理,请稍后重试", @@ -305,14 +307,19 @@ export async function runRecallController(runtime, options = {}) { } } - if (!runtime.getCurrentGraph()) { + const hasGraph = !!runtime.getCurrentGraph(); + console.warn("[ST-BME:DIAG:RECALL] hasGraph:", hasGraph); + if (!hasGraph) { + console.warn("[ST-BME:DIAG:RECALL] EXIT: 当前无图谱"); return runtime.createRecallRunResult("skipped", { reason: "当前无图谱", }); } const settings = runtime.getSettings(); + console.warn("[ST-BME:DIAG:RECALL] settings.enabled:", settings.enabled, "recallEnabled:", settings.recallEnabled); if (!settings.enabled || !settings.recallEnabled) { + console.warn("[ST-BME:DIAG:RECALL] EXIT: 召回功能未启用"); return runtime.createRecallRunResult("skipped", { reason: "召回功能未启用", }); @@ -321,8 +328,12 @@ export async function runRecallController(runtime, options = {}) { typeof runtime.isGraphReadableForRecall === "function" ? runtime.isGraphReadableForRecall() : runtime.isGraphReadable(); + const chatId = typeof runtime.getCurrentChatId === "function" ? runtime.getCurrentChatId() : "(no fn)"; + const loadState = runtime.getGraphPersistenceLoadState?.() || "(no fn)"; + console.warn("[ST-BME:DIAG:RECALL] isReadableForRecall:", isReadableForRecall, "chatId:", chatId, "loadState:", loadState); if (!isReadableForRecall) { const reason = runtime.getGraphMutationBlockReason("召回"); + console.warn("[ST-BME:DIAG:RECALL] EXIT: 图谱不可读 -", reason); runtime.setLastRecallStatus("等待图谱加载", reason, "warning", { syncRuntime: true, });