mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix (memory/builtin): keep status dirty state stable across invocations
This commit is contained in:
@@ -101,6 +101,7 @@ export class MemoryIndexManager implements MemorySearchManager {
|
||||
static async get(params: {
|
||||
cfg: OpenClawConfig;
|
||||
agentId: string;
|
||||
purpose?: "default" | "status";
|
||||
}): Promise<MemoryIndexManager | null> {
|
||||
const { cfg, agentId } = params;
|
||||
const settings = resolveMemorySearchConfig(cfg, agentId);
|
||||
@@ -129,6 +130,7 @@ export class MemoryIndexManager implements MemorySearchManager {
|
||||
workspaceDir,
|
||||
settings,
|
||||
providerResult,
|
||||
purpose: params.purpose,
|
||||
});
|
||||
INDEX_CACHE.set(key, manager);
|
||||
return manager;
|
||||
@@ -141,6 +143,7 @@ export class MemoryIndexManager implements MemorySearchManager {
|
||||
workspaceDir: string;
|
||||
settings: ResolvedMemorySearchConfig;
|
||||
providerResult: EmbeddingProviderResult;
|
||||
purpose?: "default" | "status";
|
||||
}) {
|
||||
this.cacheKey = params.cacheKey;
|
||||
this.cfg = params.cfg;
|
||||
@@ -175,7 +178,8 @@ export class MemoryIndexManager implements MemorySearchManager {
|
||||
this.ensureWatcher();
|
||||
this.ensureSessionListener();
|
||||
this.ensureIntervalSync();
|
||||
this.dirty = this.sources.has("memory");
|
||||
const statusOnly = params.purpose === "status";
|
||||
this.dirty = this.sources.has("memory") && (statusOnly ? !meta : true);
|
||||
this.batch = this.resolveBatchConfig();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user