Skip to content

fix(plugins): cache installed manifest registry index fingerprint to avoid repeated fs probes#86850

Closed
Jefsky wants to merge 20 commits into
openclaw:mainfrom
Jefsky:fix/plugin-metadata-fingerprint-cache
Closed

fix(plugins): cache installed manifest registry index fingerprint to avoid repeated fs probes#86850
Jefsky wants to merge 20 commits into
openclaw:mainfrom
Jefsky:fix/plugin-metadata-fingerprint-cache

Conversation

@Jefsky

@Jefsky Jefsky commented May 26, 2026

Copy link
Copy Markdown
Contributor

Resolves #86791

The resolveInstalledManifestRegistryIndexFingerprint function caused repeated synchronous filesystem operations (realpath/stat) every time the same InstalledPluginIndex was fingerprinted. During hot-path plugin metadata snapshot lookups, the same index object could be fingerprinted multiple times per call cycle.

Changes:

  • Added a WeakMap<object, string> cache keyed on the index object reference
  • Cache entries are automatically invalidated when the index object is GC'd
  • Added clearInstalledManifestRegistryIndexFingerprintCache export for test use

Profile evidence showed lstat/realpathSync/stat chains under:

  • resolveInstalledManifestRegistryIndexFingerprint
  • buildInstalledManifestRegistryIndexKey
  • resolvePackageJsonPath
  • safeFileSignature

This fix avoids re-executing those filesystem probes when the same index object is fingerprinted again.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web scripts Repository scripts commands Command implementations agents Agent runtime and tooling extensions: qa-lab size: M triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Close: current main and the v2026.6.6 release already contain a guarded installed-index fingerprint cache with regression coverage, while this branch carries an older unconditional cache plus unrelated dirty changes.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the guarded current-main and v2026.6.6 implementation as canonical, and leave any protected linked issue or related protected PR cleanup to maintainers.

Do we have a high-confidence way to reproduce the issue?

No live profiler reproduction was run in this read-only review. The original hot-path source path and the submitted stale-cache failure mode are source-reproducible, and current main now has focused regression coverage for the cache boundary.

Is this the best way to solve the issue?

No, this PR branch is not the best way to solve the issue. Current main's guarded cacheability checks and invalidation tests are the safer maintained implementation.

Security review:

Security review cleared: The diff touches workflow and script surfaces, but I found no concrete security or supply-chain regression beyond the functional merge risks already noted.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vincentkoc: Current main and the v2026.6.6 tag attribute the guarded installed-manifest fingerprint cache, tests, and plugin metadata cache lifecycle file to Vincent Koc in the available history. (role: recent area contributor; confidence: high; commits: fc6d448138fc, 8c802aa68351; files: src/plugins/manifest-registry-installed.ts, src/plugins/manifest-registry-installed.test.ts, src/plugins/plugin-metadata-lifecycle.ts)
  • galiniliev: The linked issue and related open protected PR describe the same installed-manifest fingerprint hot-path problem and proposed cache boundary. (role: related reporter and proposed-fix author; confidence: medium; commits: 8fb15dd60b21; files: src/plugins/manifest-registry-installed.ts, src/plugins/manifest-registry-installed.fingerprint.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 44e6caff5401; fix evidence: release v2026.6.6, commit 8c802aa68351.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels May 26, 2026
@clawsweeper

clawsweeper Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper PR egg

🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat.

Where did the egg go?
  • The egg game starts only after the PR passes the real-behavior proof check.
  • Before that, no creature or rarity is rolled. The treat waits for real proof.
  • This is still just collectible flavor: proof affects review readiness, not creature quality.

@BingqingLyu

This comment was marked as spam.

@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels May 29, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: telegram Channel integration: telegram channel: whatsapp-web Channel integration: whatsapp-web commands Command implementations docs Improvements or additions to documentation extensions: qa-lab merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Plugin metadata hot paths repeat installed manifest filesystem probes

4 participants