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

@@ -164,7 +164,7 @@
<div class="settings-tab active" data-tab="tab-summary">总结设置</div> <div class="settings-tab active" data-tab="tab-summary">总结设置</div>
<div class="settings-tab" data-tab="tab-vector">向量设置</div> <div class="settings-tab" data-tab="tab-vector">向量设置</div>
<div class="settings-tab" data-tab="tab-debug">调试</div> <div class="settings-tab" data-tab="tab-debug">调试</div>
<div class="settings-tab" data-tab="tab-guide">使用说明</div> <div class="settings-tab" data-tab="tab-guide">说明</div>
</div> </div>
<button class="modal-close" id="settings-close"> <button class="modal-close" id="settings-close">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
@@ -514,7 +514,7 @@
</div> </div>
<div class="settings-hint" style="margin-top:8px"> <div class="settings-hint" style="margin-top:8px">
向量化现有数据,生成速度很快 向量化现有数据
</div> </div>
<!-- 导入导出 --> <!-- 导入导出 -->
@@ -800,4 +800,4 @@
<script src="story-summary-ui.js"></script> <script src="story-summary-ui.js"></script>
</body> </body>
</html> </html>

View File

@@ -468,8 +468,8 @@ async function handleGenerateVectors(vectorCfg) {
const message = chat[floor]; const message = chat[floor];
if (!message) continue; if (!message) continue;
const { chunks, status } = chunkMessage(message, floor, vectorCfg, true); const chunks = chunkMessage(floor, message);
if (status === "skip") continue; if (!chunks.length) continue;
allChunks.push(...chunks); allChunks.push(...chunks);
} }
@@ -548,6 +548,10 @@ async function handleGenerateVectors(vectorCfg) {
await sendVectorStatsToFrame(); await sendVectorStatsToFrame();
xbLog.info(MODULE_ID, `向量生成完成: L0=${atoms.length}, L1=${l1Vectors.length}, L2=${l2Pairs.length}`); 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 { } finally {
release(); release();
vectorCancelled = false; vectorCancelled = false;