Repository navigation
refactor(diffs): move ephemeral artifacts to SQLite - #109328
Conversation
# Conflicts: # scripts/plugin-sdk-surface-report.mjs
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4c702cb8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77b396277f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # docs/.generated/plugin-sdk-api-baseline.sha256
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 349bce6307
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| installRecord.source === "npm" && | ||
| installRecord.artifactKind === undefined && | ||
| installRecord.sourcePath === undefined && |
There was a problem hiding this comment.
Migrate stale install provenance before rejecting trust
For users who already reinstalled an official plugin from a registry after a local npm-pack/path install under the previous merge-on-write recordPluginInstall, the persisted record can still contain sourcePath/artifactKind even though installPath, spec, and resolvedName now point at the registry package. Fresh evidence beyond the earlier fix: recordPluginInstall only replaces future writes, while the registry load path reads existing plugins.installs unchanged, so this new gate keeps trustedOfficialInstall false on upgrade and external official Diffs throws when it opens openBlobStore; add a doctor/load migration or normalize stale local-artifact fields before this trust check.
Useful? React with 👍 / 👎.
* refactor(diffs): move ephemeral artifacts to SQLite * fix(plugin-state): satisfy SDK validation gates * test(diffs): satisfy lint contracts * fix(plugin-state): count expired blobs toward quotas * fix(plugin-state): harden blob storage boundaries * fix(plugins): replace stale install provenance
* refactor(diffs): move ephemeral artifacts to SQLite * fix(plugin-state): satisfy SDK validation gates * test(diffs): satisfy lint contracts * fix(plugin-state): count expired blobs toward quotas * fix(plugin-state): harden blob storage boundaries * fix(plugins): replace stale install provenance
What Problem This Solves
Diffs viewer HTML, access metadata, and rendered-file TTL metadata still used JSON/HTML temp sidecars even though OpenClaw-owned runtime state is SQLite-first. Those files split authorization and payload reads, escaped shared storage limits, and made backup/privacy handling inconsistent.
Why This Change Was Made
Adds a bounded trusted-plugin BLOB store on the shared SQLite database, then moves Diffs viewer artifacts onto it. Viewer HTML is gzip-compressed, only the bearer token hash is persisted, and authorization plus payload retrieval use one row snapshot. PNG/PDF outputs remain named temporary artifacts because channel delivery needs a file path, while their lifecycle metadata moves to SQLite. The privileged runtime stays limited to bundled and catalog-backed official plugins; local npm-pack and linked-path installs cannot inherit official trust from a matching package name. Completed installs replace stale provenance, so a later registry reinstall can regain official trust without weakening that fail-closed boundary.
Legacy Diffs JSON/HTML caches are intentionally discarded rather than imported because they are ephemeral (30-minute default, 6-hour maximum). TTL BLOB rows are excluded from restorable backups; durable no-TTL plugin BLOBs remain restorable.
User Impact
Diffs view, file, and both modes retain their existing output contract without writing
meta.json,file-meta.json, orviewer.html. Old ephemeral viewer URLs do not survive the upgrade. Expired viewer bytes are reclaimed on access or owner cleanup, and rendered files are deleted from owner-claimed expiry metadata.Evidence
toolNames=["diffs"]and one HTTP route. The real mode=bothagent scenario reached model dispatch, then stopped at the credential boundary because the isolated box had no provider API key.AI-assisted: yes. I reviewed the implementation and validation results. No session transcript is attached.