























@@ -46,6 +46,7 @@ import {
4646} from "./dreaming-repair.js";
4747import { asRecord } from "./dreaming-shared.js";
4848import { resolveShortTermPromotionDreamingConfig } from "./dreaming.js";
49+import { formatMemoryVectorDegradedWriteReason } from "./memory/manager-vector-warning.js";
4950import { previewGroundedRemMarkdown } from "./rem-evidence.js";
5051import { previewRemHarness } from "./rem-harness.js";
5152import {
@@ -1146,17 +1147,34 @@ export async function runMemoryIndex(opts: MemoryCommandOptions) {
11461147if (qmdIndexSummary) {
11471148defaultRuntime.log(qmdIndexSummary);
11481149}
1149-const postIndexStatus = manager.status();
1150+let postIndexStatus = manager.status();
1151+let semanticVectorAvailable = postIndexStatus.vector?.semanticAvailable;
1152+const vectorStoreAvailable =
1153+postIndexStatus.vector?.storeAvailable ?? postIndexStatus.vector?.available;
1154+if (
1155+postIndexStatus.backend === "builtin" &&
1156+(postIndexStatus.vector?.enabled ?? false) &&
1157+semanticVectorAvailable === undefined &&
1158+vectorStoreAvailable !== false &&
1159+typeof manager.probeVectorAvailability === "function"
1160+) {
1161+semanticVectorAvailable = await manager.probeVectorAvailability();
1162+postIndexStatus = manager.status();
1163+semanticVectorAvailable =
1164+postIndexStatus.vector?.semanticAvailable ?? semanticVectorAvailable;
1165+}
11501166const vectorEnabled = postIndexStatus.vector?.enabled ?? false;
11511167const vectorAvailable =
1152-postIndexStatus.vector?.storeAvailable ?? postIndexStatus.vector?.available;
1168+semanticVectorAvailable ??
1169+postIndexStatus.vector?.semanticAvailable ??
1170+postIndexStatus.vector?.available ??
1171+postIndexStatus.vector?.storeAvailable;
11531172const vectorLoadErr = postIndexStatus.vector?.loadError;
11541173if (vectorEnabled && vectorAvailable === false) {
1155-const errDetail = vectorLoadErr ? `: ${vectorLoadErr}` : "";
11561174// Indexing still persisted chunks/FTS state; keep the command successful but
11571175// emit a stderr warning so operators and scripts can detect degraded recall.
11581176defaultRuntime.error(
1159-`Memory index WARNING (${agentId}): chunks_vec not updated — sqlite-vec unavailable${errDetail}. Vector recall degraded.`,
1177+`Memory index WARNING (${agentId}): chunks_vec not updated — ${formatMemoryVectorDegradedWriteReason(vectorLoadErr)}. Vector recall degraded.`,
11601178);
11611179} else {
11621180defaultRuntime.log(`Memory index updated (${agentId}).`);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。