






















@@ -87,35 +87,51 @@ discovery order. When setup runtime does execute, registry diagnostics report
8787drift between `setup.providers` / `setup.cliBackends` and the providers or CLI
8888backends registered by setup-api without blocking legacy plugins.
898990-### What the loader caches
91-92-OpenClaw keeps short in-process caches for:
90+### Plugin cache boundary
91+92+OpenClaw does not cache plugin discovery results or direct manifest registry
93+data behind wall-clock windows. Installs, manifest edits, and load-path changes
94+must become visible on the next explicit metadata read or snapshot rebuild.
95+96+The safe metadata fast path is explicit object ownership, not a hidden cache.
97+Gateway startup hot paths should pass the current `PluginMetadataSnapshot`, the
98+derived `PluginLookUpTable`, or an explicit manifest registry through the call
99+chain. Config validation, startup auto-enable, plugin bootstrap, setup lookup,
100+and provider selection can reuse those objects while they represent the current
101+config and plugin inventory. When that input changes, rebuild and replace the
102+snapshot instead of mutating it or keeping historical copies.
103+Views over the active plugin registry and bundled channel bootstrap helpers
104+should be recomputed from the current registry/root. Short-lived maps are fine
105+inside one call to dedupe work or guard reentry; they must not become process
106+metadata caches.
107+108+For plugin loading, the persistent cache layer is runtime loading. It may reuse
109+loader state when code or installed artifacts are actually loaded, such as:
110+111+- `PluginLoaderCacheState` and compatible active runtime registries
112+- jiti/module caches and public-surface loader caches used to avoid importing
113+ the same runtime surface repeatedly
114+- runtime dependency mirrors and filesystem caches for installed plugin
115+ artifacts
116+- short-lived per-call maps for path normalization or duplicate resolution
117+118+Those caches are data-plane implementation details. They must not answer
119+control-plane questions such as "which plugin owns this provider?" unless the
120+caller deliberately asked for runtime loading.
121+122+Do not add persistent or wall-clock caches for:
9312394124- discovery results
95-- manifest registry data
96-- loaded plugin registries
97-98-These caches reduce bursty startup and repeated command overhead. They are safe
99-to think of as short-lived performance caches, not persistence.
100-101-Gateway startup hot paths should prefer the current `PluginMetadataSnapshot`,
102-the derived `PluginLookUpTable`, or an explicit manifest registry passed through
103-the call chain. Config validation, startup auto-enable, and plugin bootstrap use
104-the same snapshot when available. For callers that still rebuild manifest
105-metadata from the persisted installed plugin index, OpenClaw also keeps a small
106-bounded fallback cache keyed by the installed index, request shape, config
107-policy, runtime roots, and manifest/package file signatures. That cache is only a
108-fallback for repeated installed-index reconstruction; it is not a mutable runtime
109-plugin registry.
110-111-Performance note:
112-113-- Set `OPENCLAW_DISABLE_PLUGIN_DISCOVERY_CACHE=1` or
114-`OPENCLAW_DISABLE_PLUGIN_MANIFEST_CACHE=1` to disable these caches.
115-- Set `OPENCLAW_DISABLE_INSTALLED_PLUGIN_MANIFEST_REGISTRY_CACHE=1` to disable
116- only the installed-index manifest-registry fallback cache.
117-- Tune cache windows with `OPENCLAW_PLUGIN_DISCOVERY_CACHE_MS` and
118-`OPENCLAW_PLUGIN_MANIFEST_CACHE_MS`.
125+- direct manifest registries
126+- manifest registries reconstructed from the installed plugin index
127+- provider owner lookup, model suppression, provider policy, or public-artifact
128+ metadata
129+- any other manifest-derived answer where a changed manifest, installed index,
130+ or load path should be visible on the next metadata read
131+132+Callers that rebuild manifest metadata from the persisted installed plugin
133+index reconstruct that registry on demand. The installed index is durable
134+source-plane state; it is not a hidden in-process metadata cache.
119135120136## Registry model
121137@@ -944,7 +960,7 @@ source-plane diagnostics without adding a second raw filesystem-path disclosure
944960surface. The persisted `plugins/installs.json` plugin index is the install
945961source of truth and can be refreshed without loading plugin runtime modules.
946962Its `installRecords` map is durable even when a plugin manifest is missing or
947-invalid; its `plugins` array is a rebuildable manifest/cache view.
963+invalid; its `plugins` array is a rebuildable manifest view.
948964949965## Context engine plugins
950966此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。