Skip to content

fix(plugins): enable metadata snapshot cache for status diagnostics#73410

Closed
xialonglee wants to merge 1 commit into
openclaw:mainfrom
xialonglee:fix/issue-73291-status-cache
Closed

fix(plugins): enable metadata snapshot cache for status diagnostics#73410
xialonglee wants to merge 1 commit into
openclaw:mainfrom
xialonglee:fix/issue-73291-status-cache

Conversation

@xialonglee
Copy link
Copy Markdown
Contributor

fix(plugins): enable metadata snapshot cache for status diagnostics

Summary

Fixes #73291.

This PR enables plugin metadata snapshot caching (default 1 second TTL) for validate-mode metadata loads used by status diagnostics, reducing repeated manifest discovery/parse work during openclaw status text-mode scans.

Issue Evidence Is Clear

What Changed

  • Updated src/plugins/runtime/metadata-registry-loader.ts
    • Changed metadata snapshot load option from cache: false to cache: true.
    • Keeps behavior read-only (activate: false, mode: "validate"), only allowing short-lived manifest/discovery cache reuse.
  • Updated src/plugins/runtime/metadata-registry-loader.test.ts
    • Updated expectation to assert cache: true.

Why This Small Fix

  • Uses existing cache implementation and defaults (1 second TTL) with no new flags or config surface.
  • Keeps blast radius minimal and aligned with issue request for a low-cost, practical fix.
  • Accepts tiny short-window staleness in diagnostics for significantly lower repeated filesystem/manifest overhead.

Validation

  • pnpm docs:list
  • pnpm test src/plugins/runtime/metadata-registry-loader.test.ts

Risk

  • Very low: metadata may be up to ~1 second stale in read-only diagnostics paths.
  • No activation/runtime behavior changes; only snapshot cache policy changed.

AI-assisted

  • AI-assisted and manually reviewed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR changes the cache option in loadPluginMetadataRegistrySnapshot from false to true, enabling the existing short-lived manifest/discovery cache (1 second TTL) for the read-only validate-mode snapshot loads that back openclaw status diagnostics. The corresponding test expectation is updated to match. The change is correct and safe: when the cache is hit with activate: false, the loader returns cached.registry without executing the activation restore block (agent harnesses, commands, interactive handlers, etc.), so there are no side-effect risks.

Confidence Score: 5/5

Safe to merge — a focused one-line change with correct test coverage and no activation side-effect risk.

The change is minimal, well-understood, and the cache hit path for non-activating loads is guarded such that no activation state (commands, handlers, agent harnesses) is restored. The test is updated consistently. No issues found.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(plugins): enable metadata snapshot c..." | Re-trigger Greptile

@steipete
Copy link
Copy Markdown
Contributor

Thanks @xialonglee. I checked this against current main and #73291 is already fixed on the actual status text path by b7a1bfd2d7 (fix(plugins): cache installed manifest registry).

The slow path from the issue is buildPluginRegistrySnapshotReport() -> loadPluginManifestRegistryForInstalledIndex(), not loadPluginMetadataRegistrySnapshot(). Current main now caches the installed-index manifest registry with manifest/package file signatures and has regression coverage in src/plugins/manifest-registry-installed.test.ts.

Verified locally:

  • pnpm test src/plugins/manifest-registry-installed.test.ts src/plugins/status.registry-snapshot.test.ts src/plugins/status.test.ts
  • after the one-time stale-dist rebuild, pnpm openclaw status --timeout 3000 completed in ~3.35s

Closing this PR as superseded by the landed fix.

@steipete steipete closed this Apr 28, 2026
@xialonglee xialonglee deleted the fix/issue-73291-status-cache branch April 28, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI openclaw status text mode extremely slow (~20-30s) due to cache: false hardcoded in manifest registry loader

2 participants