Fix vector generation error handling

This commit is contained in:
2026-02-10 21:37:28 +08:00
parent 062df60570
commit 93aa86d3ca
2 changed files with 9 additions and 5 deletions

View File

@@ -468,8 +468,8 @@ async function handleGenerateVectors(vectorCfg) {
const message = chat[floor];
if (!message) continue;
const { chunks, status } = chunkMessage(message, floor, vectorCfg, true);
if (status === "skip") continue;
const chunks = chunkMessage(floor, message);
if (!chunks.length) continue;
allChunks.push(...chunks);
}
@@ -548,6 +548,10 @@ async function handleGenerateVectors(vectorCfg) {
await sendVectorStatsToFrame();
xbLog.info(MODULE_ID, `向量生成完成: L0=${atoms.length}, L1=${l1Vectors.length}, L2=${l2Pairs.length}`);
} catch (e) {
xbLog.error(MODULE_ID, '向量生成失败', e);
postToFrame({ type: "VECTOR_GEN_PROGRESS", phase: "ALL", current: -1, total: 0 });
await sendVectorStatsToFrame();
} finally {
release();
vectorCancelled = false;