fix(recall): skip pre-recall recovery on reroll reuse

This commit is contained in:
opencode
2026-05-15 19:17:30 +00:00
parent 06e92cda7c
commit a5c4e12a76
2 changed files with 37 additions and 21 deletions

View File

@@ -513,26 +513,6 @@ export async function runRecallController(runtime, options = {}) {
reason: "召回功能未启用",
});
}
const isReadableForRecall =
typeof runtime.isGraphReadableForRecall === "function"
? runtime.isGraphReadableForRecall()
: runtime.isGraphReadable();
if (!isReadableForRecall) {
const reason = runtime.getGraphMutationBlockReason("召回");
runtime.setLastRecallStatus("等待图谱加载", reason, "warning", {
syncRuntime: true,
});
return runtime.createRecallRunResult("skipped", {
reason,
});
}
if (runtime.isGraphMetadataWriteAllowed()) {
if (!(await runtime.recoverHistoryIfNeeded("pre-recall"))) {
return runtime.createRecallRunResult("skipped", {
reason: "历史恢复未就绪",
});
}
}
const context = runtime.getContext();
const chat = context.chat;
@@ -690,6 +670,27 @@ export async function runRecallController(runtime, options = {}) {
});
}
const isReadableForRecall =
typeof runtime.isGraphReadableForRecall === "function"
? runtime.isGraphReadableForRecall()
: runtime.isGraphReadable();
if (!isReadableForRecall) {
const reason = runtime.getGraphMutationBlockReason("召回");
runtime.setLastRecallStatus("等待图谱加载", reason, "warning", {
syncRuntime: true,
});
return runtime.createRecallRunResult("skipped", {
reason,
});
}
if (runtime.isGraphMetadataWriteAllowed()) {
if (!(await runtime.recoverHistoryIfNeeded("pre-recall"))) {
return runtime.createRecallRunResult("skipped", {
reason: "历史恢复未就绪",
});
}
}
const runId = runtime.nextRecallRunSequence();
let recallPromise = null;
recallPromise = (async () => {