Skip to content

Commit beac3c9

Browse files
committed
docs(memory): clarify watcher default wording
1 parent d4cc83b commit beac3c9

6 files changed

Lines changed: 12 additions & 15 deletions

File tree

docs/concepts/memory-builtin.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ OpenClaw indexes `MEMORY.md` and `memory/*.md` into chunks (~400 tokens with
8585
- **Storage maintenance:** SQLite WAL sidecars are bounded with periodic and
8686
shutdown checkpoints.
8787
- **File watching:** changes to memory files trigger a debounced reindex (1.5s).
88-
It stays enabled by default, including in gateway mode, so small and typical
89-
workspaces keep near-real-time freshness. Large memory trees, `extraPaths`, or
90-
QMD collections can create file-descriptor pressure in long-lived gateways;
91-
set `sync.watch: false` if that happens.
88+
File watching is enabled by default, including for gateways, so memory edits
89+
become searchable without a manual reindex. Large memory trees, `extraPaths`,
90+
or QMD collections can use many file descriptors in long-lived gateways; set
91+
`sync.watch: false` for affected agents if that becomes a problem.
9292
- **Auto-reindex:** when the embedding provider, model, or chunking config
9393
changes, the entire index is rebuilt automatically.
9494
- **Reindex on demand:** `openclaw memory index --force`
@@ -129,8 +129,8 @@ openclaw memory index --force --agent main
129129
Both standalone CLI commands and the Gateway use the same `local` provider id.
130130
Set `memorySearch.provider: "local"` when you want local embeddings.
131131

132-
**Stale results?** Run `openclaw memory index --force` to rebuild. The watcher
133-
may be disabled explicitly or miss changes in rare edge cases.
132+
**Stale results?** Run `openclaw memory index --force` to rebuild. Use this when
133+
file watching is disabled or misses a change.
134134

135135
**sqlite-vec not loading?** OpenClaw falls back to in-process cosine similarity
136136
automatically. `openclaw memory status --deep` reports the local vector store

docs/reference/memory-config.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,9 @@ QMD model overrides stay on the QMD side, not OpenClaw config. If you need to ov
527527
</Accordion>
528528
</AccordionGroup>
529529

530-
QMD boot refreshes use a one-shot subprocess path during gateway startup. The long-lived QMD manager owns the regular file watcher and interval timers when memory search is opened for interactive use. Gateway configs that leave `memorySearch.sync.watch` enabled can warn when memory/QMD surfaces look prone to file-descriptor pressure; set `sync.watch: false` for affected agents if FD usage grows.
530+
QMD boot refreshes use a one-shot subprocess path during gateway startup. The long-lived QMD manager owns the regular file watcher and interval timers when memory search is opened for interactive use.
531+
532+
Gateway configs can warn when `memorySearch.sync.watch` is enabled for memory or QMD surfaces that may use many file descriptors. If watcher FD usage grows, set `sync.watch: false` for the affected agents and use manual indexing or `sync.intervalMinutes` for freshness.
531533

532534
### Full QMD example
533535

extensions/memory-core/src/memory/qmd-manager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,8 +1617,6 @@ export class QmdMemoryManager implements MemorySearchManager {
16171617
this.watcher.on("change", markDirty);
16181618
this.watcher.on("unlink", markDirty);
16191619
this.watcher.on("error", (err) => {
1620-
// File watcher errors (for example ENOSPC/EMFILE) should not crash the
1621-
// gateway. Search still works; automatic watch freshness may be degraded.
16221620
const message = err instanceof Error ? err.message : String(err);
16231621
log.warn(`qmd watcher error: ${message}`);
16241622
});

src/agents/memory-search.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ export type ResolvedMemorySearchConfig = {
113113
export type ResolvedMemorySearchSyncConfig = ResolvedMemorySearchConfig["sync"];
114114
export type MemorySearchResolvePurpose = "default" | "status" | "cli";
115115
export type MemorySearchResolveOptions = {
116-
/**
117-
* @deprecated Accepted for SDK compatibility. Memory watch defaults no longer
118-
* vary by resolver purpose.
119-
*/
116+
/** @deprecated No-op; kept for resolver call-site compatibility. */
120117
purpose?: MemorySearchResolvePurpose;
121118
};
122119

src/config/schema.help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ export const FIELD_HELP: Record<string, string> = {
13311331
"agents.defaults.memorySearch.sync.onSearch":
13321332
"Uses lazy sync by scheduling reindex on search after content changes are detected. Keep enabled for lower idle overhead, or disable if you require pre-synced indexes before any query.",
13331333
"agents.defaults.memorySearch.sync.watch":
1334-
"Watches memory files and schedules index updates from file-change events (default: true). Disable on large memory trees, extraPaths, QMD collections, or multi-agent gateways if watcher file-descriptor pressure appears.",
1334+
"Watches memory files and schedules index updates from file-change events. Default: true. Disable for large memory trees, extraPaths, QMD collections, or multi-agent gateways if watcher file-descriptor usage becomes a problem.",
13351335
"agents.defaults.memorySearch.sync.watchDebounceMs":
13361336
"Debounce window in milliseconds for coalescing rapid file-watch events before reindex runs. Increase to reduce churn on frequently-written files, or lower for faster freshness.",
13371337
"agents.defaults.memorySearch.sync.embeddingBatchTimeoutSeconds":

src/config/types.tools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ export type MemorySearchConfig = {
523523
sync?: {
524524
onSessionStart?: boolean;
525525
onSearch?: boolean;
526-
/** Watch memory files for near-real-time reindexing. Default: true. */
526+
/** Watch memory files for reindexing (default: true). */
527527
watch?: boolean;
528528
watchDebounceMs?: number;
529529
intervalMinutes?: number;

0 commit comments

Comments
 (0)