Skip to content

Commit 7fae11b

Browse files
committed
fix(plugins): persist clawhub artifact metadata
1 parent aafdc59 commit 7fae11b

25 files changed

Lines changed: 268 additions & 93 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Docs: https://docs.openclaw.ai
1616
- Codex/app-server: resolve managed binaries from bundled `dist` chunks and from the `@openai/codex` package bin when installs do not provide a nearby `.bin/codex` shim, avoiding false missing-binary startup failures.
1717
- Plugins/source checkout: discover source-only plugins such as Codex from the `extensions/*` workspace while using npm package excludes as the packaged-core boundary, removing the stale core-bundle metadata path.
1818
- Plugins/ClawHub: install ClawPack artifacts from the explicit npm-pack `.tgz` resolver path instead of the legacy ZIP-shaped placeholder route. Thanks @vincentkoc.
19+
- Plugins/ClawHub: persist ClawHub artifact kind plus npm integrity, shasum, and tarball metadata on ClawPack install records for update and diagnostics flows. Thanks @vincentkoc.
1920
- Control UI: allow deployments to configure grouped chat message max-width with a validated `gateway.controlUi.chatMessageMaxWidth` setting instead of patching bundled CSS after upgrades. Fixes #67935. Thanks @xiew4589-lang.
2021
- Control UI/Cron: ignore malformed persisted cron rows without valid payloads before they enter UI state and guard stale cron render paths, preventing blank Control UI sections after a bad cron snapshot. Fixes #55047 and #54439; supersedes #54550 and #54552.
2122
- Control UI/sessions: bound the default Sessions tab query to recent activity and fewer rows, avoiding expensive full-history loads while keeping filters editable. Fixes #76050. (#76051) Thanks @Neomail2.

‎docs/cli/plugins.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ openclaw plugins install npm:openclaw-codex-app-server
172172
openclaw plugins install npm:@scope/[email protected]
173173
```
174174

175-
OpenClaw checks the advertised plugin API / minimum gateway compatibility before install. When the selected ClawHub version publishes a ClawPack artifact, OpenClaw downloads the versioned npm-pack `.tgz`, verifies the ClawHub digest header and the artifact digest, then installs it through the normal archive path. Older ClawHub versions without ClawPack metadata still install through the legacy package archive verification path. Recorded installs keep their ClawHub source metadata and ClawPack digest facts for later updates.
175+
OpenClaw checks the advertised plugin API / minimum gateway compatibility before install. When the selected ClawHub version publishes a ClawPack artifact, OpenClaw downloads the versioned npm-pack `.tgz`, verifies the ClawHub digest header and the artifact digest, then installs it through the normal archive path. Older ClawHub versions without ClawPack metadata still install through the legacy package archive verification path. Recorded installs keep their ClawHub source metadata, artifact kind, npm integrity, npm shasum, tarball name, and ClawPack digest facts for later updates.
176176
Unversioned ClawHub installs keep an unversioned recorded spec so `openclaw plugins update` can follow newer ClawHub releases; explicit version or tag selectors such as `clawhub:[email protected]` and `clawhub:pkg@beta` remain pinned to that selector.
177177

178178
#### Marketplace shorthand

‎docs/tools/clawhub.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ Site: [clawhub.ai](https://clawhub.ai)
8484
`minGatewayVersion` compatibility before archive install runs, so
8585
incompatible hosts fail closed early instead of partially installing
8686
the package. When a package version publishes a ClawPack artifact,
87-
OpenClaw prefers the exact uploaded npm-pack `.tgz`, verifies the ClawHub digest header and
88-
downloaded bytes, and records the ClawPack digest metadata for later
87+
OpenClaw prefers the exact uploaded npm-pack `.tgz`, verifies the ClawHub
88+
digest header and downloaded bytes, and records the artifact kind, npm
89+
integrity, npm shasum, tarball name, and ClawPack digest metadata for later
8990
updates. Older package versions without ClawPack metadata still use the
9091
legacy package archive verification path.
9192

‎scripts/e2e/lib/kitchen-sink-plugin/assertions.mjs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,12 @@ function assertInstalled() {
392392
if (!record.clawpackSha256 || typeof record.clawpackSize !== "number") {
393393
throw new Error(`missing kitchen-sink ClawPack metadata: ${JSON.stringify(record)}`);
394394
}
395+
if (record.artifactKind !== "npm-pack" || record.artifactFormat !== "tgz") {
396+
throw new Error(`missing kitchen-sink ClawHub artifact metadata: ${JSON.stringify(record)}`);
397+
}
398+
if (!record.npmIntegrity || !record.npmShasum || !record.npmTarballName) {
399+
throw new Error(`missing kitchen-sink npm artifact metadata: ${JSON.stringify(record)}`);
400+
}
395401
}
396402
if (typeof record.installPath !== "string" || record.installPath.length === 0) {
397403
throw new Error("missing kitchen-sink install path");

‎scripts/e2e/lib/plugins/assertions.mjs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,14 @@ function assertClawHubInstalled() {
537537
if (!record.clawpackSha256 || typeof record.clawpackSize !== "number") {
538538
throw new Error(`missing ClawHub ClawPack metadata for ${pluginId}: ${JSON.stringify(record)}`);
539539
}
540+
if (record.artifactKind !== "npm-pack" || record.artifactFormat !== "tgz") {
541+
throw new Error(`missing ClawHub artifact metadata for ${pluginId}: ${JSON.stringify(record)}`);
542+
}
543+
if (!record.npmIntegrity || !record.npmShasum || !record.npmTarballName) {
544+
throw new Error(
545+
`missing ClawHub npm artifact metadata for ${pluginId}: ${JSON.stringify(record)}`,
546+
);
547+
}
540548

541549
const installPath = record.installPath.replace(/^~(?=$|\/)/u, process.env.HOME);
542550
const extensionsRoot = path.join(process.env.HOME, ".openclaw", "extensions");

‎src/cli/plugins-cli.list.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ describe("plugins cli list", () => {
130130
version: "2026.5.1",
131131
clawhubPackage: "openclaw-mem0",
132132
clawhubChannel: "official",
133+
artifactKind: "npm-pack",
134+
artifactFormat: "tgz",
135+
npmIntegrity: "sha512-clawpack",
136+
npmShasum: "1".repeat(40),
137+
npmTarballName: "openclaw-mem0-2026.5.1.tgz",
133138
clawpackSha256: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
134139
clawpackSpecVersion: 1,
135140
clawpackManifestSha256: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
@@ -175,6 +180,8 @@ describe("plugins cli list", () => {
175180
expect(runtimeLogs.join("\n")).toContain("Policy");
176181
expect(runtimeLogs.join("\n")).toContain("allowConversationAccess: true");
177182
expect(runtimeLogs.join("\n")).toContain("ClawHub package: openclaw-mem0");
183+
expect(runtimeLogs.join("\n")).toContain("Artifact kind: npm-pack");
184+
expect(runtimeLogs.join("\n")).toContain("Npm integrity: sha512-clawpack");
178185
expect(runtimeLogs.join("\n")).toContain(
179186
"ClawPack sha256: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
180187
);

‎src/cli/plugins-inspect-command.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ function formatInstallLines(install: PluginInstallRecord | undefined): string[]
7777
if (install.clawhubChannel) {
7878
lines.push(`ClawHub channel: ${install.clawhubChannel}`);
7979
}
80+
if (install.artifactKind) {
81+
lines.push(`Artifact kind: ${install.artifactKind}`);
82+
}
83+
if (install.artifactFormat) {
84+
lines.push(`Artifact format: ${install.artifactFormat}`);
85+
}
86+
if (install.npmIntegrity) {
87+
lines.push(`Npm integrity: ${install.npmIntegrity}`);
88+
}
89+
if (install.npmShasum) {
90+
lines.push(`Npm shasum: ${install.npmShasum}`);
91+
}
92+
if (install.npmTarballName) {
93+
lines.push(`Npm tarball: ${install.npmTarballName}`);
94+
}
8095
if (install.clawpackSha256) {
8196
lines.push(`ClawPack sha256: ${install.clawpackSha256}`);
8297
}

‎src/cli/plugins-install-command.ts‎

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { resolveArchiveKind } from "../infra/archive.js";
77
import { parseClawHubPluginSpec } from "../infra/clawhub.js";
88
import { formatErrorMessage } from "../infra/errors.js";
99
import { type BundledPluginSource, findBundledPluginSource } from "../plugins/bundled-sources.js";
10+
import { buildClawHubPluginInstallRecordFields } from "../plugins/clawhub-install-records.js";
1011
import { installPluginFromClawHub } from "../plugins/clawhub.js";
1112
import { installPluginFromGitSpec, parseGitPluginSpec } from "../plugins/git-install.js";
1213
import { resolveDefaultPluginExtensionsDir } from "../plugins/install-paths.js";
@@ -766,20 +767,9 @@ export async function runPluginInstallCommand(params: {
766767
snapshot,
767768
pluginId: result.pluginId,
768769
install: {
769-
source: "clawhub",
770+
...buildClawHubPluginInstallRecordFields(result.clawhub),
770771
spec: raw,
771772
installPath: result.targetDir,
772-
version: result.version,
773-
integrity: result.clawhub.integrity,
774-
resolvedAt: result.clawhub.resolvedAt,
775-
clawhubUrl: result.clawhub.clawhubUrl,
776-
clawhubPackage: result.clawhub.clawhubPackage,
777-
clawhubFamily: result.clawhub.clawhubFamily,
778-
clawhubChannel: result.clawhub.clawhubChannel,
779-
clawpackSha256: result.clawhub.clawpackSha256,
780-
clawpackSpecVersion: result.clawhub.clawpackSpecVersion,
781-
clawpackManifestSha256: result.clawhub.clawpackManifestSha256,
782-
clawpackSize: result.clawhub.clawpackSize,
783773
},
784774
runtime,
785775
});
@@ -800,20 +790,9 @@ export async function runPluginInstallCommand(params: {
800790
snapshot,
801791
pluginId: clawhubResult.pluginId,
802792
install: {
803-
source: "clawhub",
793+
...buildClawHubPluginInstallRecordFields(clawhubResult.clawhub),
804794
spec: preferredClawHubSpec,
805795
installPath: clawhubResult.targetDir,
806-
version: clawhubResult.version,
807-
integrity: clawhubResult.clawhub.integrity,
808-
resolvedAt: clawhubResult.clawhub.resolvedAt,
809-
clawhubUrl: clawhubResult.clawhub.clawhubUrl,
810-
clawhubPackage: clawhubResult.clawhub.clawhubPackage,
811-
clawhubFamily: clawhubResult.clawhub.clawhubFamily,
812-
clawhubChannel: clawhubResult.clawhub.clawhubChannel,
813-
clawpackSha256: clawhubResult.clawhub.clawpackSha256,
814-
clawpackSpecVersion: clawhubResult.clawhub.clawpackSpecVersion,
815-
clawpackManifestSha256: clawhubResult.clawhub.clawpackManifestSha256,
816-
clawpackSize: clawhubResult.clawhub.clawpackSize,
817796
},
818797
runtime,
819798
});

‎src/commands/doctor/shared/missing-configured-plugin-install.ts‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { listChannelPluginCatalogEntries } from "../../../channels/plugins/catal
22
import type { OpenClawConfig } from "../../../config/types.openclaw.js";
33
import type { PluginInstallRecord } from "../../../config/types.plugins.js";
44
import { parseRegistryNpmSpec } from "../../../infra/npm-registry-spec.js";
5+
import { buildClawHubPluginInstallRecordFields } from "../../../plugins/clawhub-install-records.js";
56
import { CLAWHUB_INSTALL_ERROR_CODE, installPluginFromClawHub } from "../../../plugins/clawhub.js";
67
import { resolveDefaultPluginExtensionsDir } from "../../../plugins/install-paths.js";
78
import { installPluginFromNpmSpec } from "../../../plugins/install.js";
@@ -169,21 +170,10 @@ async function installCandidate(params: {
169170
records: {
170171
...params.records,
171172
[pluginId]: {
172-
source: "clawhub",
173+
...buildClawHubPluginInstallRecordFields(clawhubResult.clawhub),
173174
spec: candidate.clawhubSpec,
174175
installPath: clawhubResult.targetDir,
175-
version: clawhubResult.version,
176176
installedAt: new Date().toISOString(),
177-
integrity: clawhubResult.clawhub.integrity,
178-
resolvedAt: clawhubResult.clawhub.resolvedAt,
179-
clawhubUrl: clawhubResult.clawhub.clawhubUrl,
180-
clawhubPackage: clawhubResult.clawhub.clawhubPackage,
181-
clawhubFamily: clawhubResult.clawhub.clawhubFamily,
182-
clawhubChannel: clawhubResult.clawhub.clawhubChannel,
183-
clawpackSha256: clawhubResult.clawhub.clawpackSha256,
184-
clawpackSpecVersion: clawhubResult.clawhub.clawpackSpecVersion,
185-
clawpackManifestSha256: clawhubResult.clawhub.clawpackManifestSha256,
186-
clawpackSize: clawhubResult.clawhub.clawpackSize,
187177
},
188178
},
189179
changes: [

‎src/commands/onboarding-plugin-install.ts‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
findBundledPluginSourceInMap,
99
resolveBundledPluginSources,
1010
} from "../plugins/bundled-sources.js";
11+
import { buildClawHubPluginInstallRecordFields } from "../plugins/clawhub-install-records.js";
1112
import { enablePluginInConfig, type PluginEnableResult } from "../plugins/enable.js";
1213
import { resolveDefaultPluginExtensionsDir } from "../plugins/install-paths.js";
1314
import { installPluginFromNpmSpec } from "../plugins/install.js";
@@ -823,20 +824,9 @@ export async function ensureOnboardingPluginInstalled(params: {
823824
next = enableResult.config;
824825
next = recordPluginInstall(next, {
825826
pluginId: result.pluginId,
826-
source: "clawhub",
827+
...buildClawHubPluginInstallRecordFields(result.clawhub),
827828
spec: clawhubSpec,
828829
installPath: result.targetDir,
829-
version: result.version,
830-
integrity: result.clawhub.integrity,
831-
resolvedAt: result.clawhub.resolvedAt,
832-
clawhubUrl: result.clawhub.clawhubUrl,
833-
clawhubPackage: result.clawhub.clawhubPackage,
834-
clawhubFamily: result.clawhub.clawhubFamily,
835-
clawhubChannel: result.clawhub.clawhubChannel,
836-
clawpackSha256: result.clawhub.clawpackSha256,
837-
clawpackSpecVersion: result.clawhub.clawpackSpecVersion,
838-
clawpackManifestSha256: result.clawhub.clawpackManifestSha256,
839-
clawpackSize: result.clawhub.clawpackSize,
840830
});
841831
return {
842832
cfg: next,

0 commit comments

Comments
 (0)