Skip to content

Commit d832ad2

Browse files
samzongsteipete
andauthored
[Feat] Add upload archive install RPC (#74430)
* feat(skills): add upload archive install RPC - src/agents/skills-archive-install.ts:83 [BOT-SCOPE]: `withExtractedArchiveRoot()` still returns unstructured extract failures, so exact transient-vs-terminal classification should be moved into the shared install-flow layer in a follow-up rather than expanding this PR. Signed-off-by: samzong <[email protected]> * fix(skills): address archive upload review findings Signed-off-by: samzong <[email protected]> * fix(skills): regen protocol bindings and classify transient archive errors * feat: gate uploaded skill installs by config * test: add docker skill install proof * docs: clarify uploaded skill archive gate * chore: refresh config docs baseline * style: format docker e2e plan test * fix: use fs-safe path checks for skill archives * fix: classify skill publish failures as unavailable * test: update skill clawhub path mock * fix: pass mutable archive root markers * fix: use current json dir mode option * test: satisfy skill upload lint * test: refresh core support expectations --------- Signed-off-by: samzong <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
1 parent 8073c95 commit d832ad2

44 files changed

Lines changed: 2721 additions & 103 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/openclaw-testing/SKILL.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,13 @@ top-level phase timings for preflight, image build, package prep, lane pools,
555555
and cleanup. Use `pnpm test:docker:timings <summary.json>` to rank slow lanes
556556
and phases before deciding whether a broader rerun is justified.
557557

558+
Skill install proof: use `pnpm test:docker:skill-install` or targeted
559+
`docker_lanes=skill-install` for live ClawHub skill-install validation. The
560+
lane installs the package tarball in a bare runner, keeps
561+
`skills.install.allowUploadedArchives=false`, resolves the current live slug
562+
from `openclaw skills search`, installs it, and verifies `.clawhub` origin/lock
563+
metadata. Prefer this checked-in script over inline heredoc Testbox recipes.
564+
558565
## Cheap Docker Reruns
559566

560567
First derive the smallest rerun command from artifacts:

‎.github/workflows/openclaw-release-checks.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ jobs:
595595
artifact_name: ${{ needs.prepare_release_package.outputs.artifact_name }}
596596
package_sha256: ${{ needs.resolve_target.outputs.package_acceptance_package_spec == '' && needs.prepare_release_package.outputs.package_sha256 || '' }}
597597
suite_profile: custom
598-
docker_lanes: doctor-switch update-channel-switch update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins-offline plugin-update
598+
docker_lanes: doctor-switch update-channel-switch skill-install update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins-offline plugin-update
599599
published_upgrade_survivor_baselines: ${{ needs.resolve_target.outputs.run_release_soak == 'true' && 'last-stable-4 2026.4.23 2026.5.2 2026.4.15' || '' }}
600600
published_upgrade_survivor_scenarios: ${{ needs.resolve_target.outputs.run_release_soak == 'true' && 'reported-issues' || '' }}
601601
telegram_mode: mock-openai

‎.github/workflows/package-acceptance.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,10 @@ jobs:
386386
docker_lanes="npm-onboard-channel-agent gateway-network config-reload"
387387
;;
388388
package)
389-
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins-offline plugin-update"
389+
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch skill-install update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins-offline plugin-update"
390390
;;
391391
product)
392-
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins plugin-update mcp-channels cron-mcp-cleanup openai-web-search-minimal openwebui"
392+
docker_lanes="npm-onboard-channel-agent doctor-switch update-channel-switch skill-install update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins plugin-update mcp-channels cron-mcp-cleanup openai-web-search-minimal openwebui"
393393
include_openwebui=true
394394
;;
395395
full)

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Docs: https://docs.openclaw.ai
66

77
### Changes
88

9+
- Gateway/skills: add an opt-in private skill archive upload install path gated by `skills.install.allowUploadedArchives`, so trusted Gateway clients can stage and install zip-backed skills only when operators explicitly enable the code-install surface. (#74430) Thanks @samzong.
910
- Agents/compaction: preserve scoped background exec/process session references across embedded compaction and after-turn runtime contexts without exposing sessions from unrelated scopes. Fixes #79284. (#79307) Thanks @TurboTheTurtle.
1011
- CLI/onboarding: improve setup, onboarding, configure, and channel command wayfinding so terminal flows explain the next useful command instead of relying on terse setup labels.
1112

‎apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4878,6 +4878,80 @@ public struct SkillsDetailResult: Codable, Sendable {
48784878
}
48794879
}
48804880

4881+
public struct SkillsUploadBeginParams: Codable, Sendable {
4882+
public let kind: String
4883+
public let slug: String
4884+
public let sizebytes: Int
4885+
public let sha256: String?
4886+
public let force: Bool?
4887+
public let idempotencykey: String?
4888+
4889+
public init(
4890+
kind: String,
4891+
slug: String,
4892+
sizebytes: Int,
4893+
sha256: String?,
4894+
force: Bool?,
4895+
idempotencykey: String?)
4896+
{
4897+
self.kind = kind
4898+
self.slug = slug
4899+
self.sizebytes = sizebytes
4900+
self.sha256 = sha256
4901+
self.force = force
4902+
self.idempotencykey = idempotencykey
4903+
}
4904+
4905+
private enum CodingKeys: String, CodingKey {
4906+
case kind
4907+
case slug
4908+
case sizebytes = "sizeBytes"
4909+
case sha256
4910+
case force
4911+
case idempotencykey = "idempotencyKey"
4912+
}
4913+
}
4914+
4915+
public struct SkillsUploadChunkParams: Codable, Sendable {
4916+
public let uploadid: String
4917+
public let offset: Int
4918+
public let database64: String
4919+
4920+
public init(
4921+
uploadid: String,
4922+
offset: Int,
4923+
database64: String)
4924+
{
4925+
self.uploadid = uploadid
4926+
self.offset = offset
4927+
self.database64 = database64
4928+
}
4929+
4930+
private enum CodingKeys: String, CodingKey {
4931+
case uploadid = "uploadId"
4932+
case offset
4933+
case database64 = "dataBase64"
4934+
}
4935+
}
4936+
4937+
public struct SkillsUploadCommitParams: Codable, Sendable {
4938+
public let uploadid: String
4939+
public let sha256: String?
4940+
4941+
public init(
4942+
uploadid: String,
4943+
sha256: String?)
4944+
{
4945+
self.uploadid = uploadid
4946+
self.sha256 = sha256
4947+
}
4948+
4949+
private enum CodingKeys: String, CodingKey {
4950+
case uploadid = "uploadId"
4951+
case sha256
4952+
}
4953+
}
4954+
48814955
public struct CronJob: Codable, Sendable {
48824956
public let id: String
48834957
public let agentid: String?
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
335083781741da50b280496b954794bdecba7c1150ce777d37534ccc1ec2c10a config-baseline.json
2-
b629f3b6ec6389eb0709e6f9149d7c3ab50431bb22124019541710873dc52cbb config-baseline.core.json
3-
9edc62ae7dfedabc645470dd03102b813fc780b9108caf675fd661104714206f config-baseline.channel.json
4-
1da42cb10427fb08510f29732493d24851ab915a424f91556569febdd450d9c3 config-baseline.plugin.json
1+
6a0d49baf0a07563146d9c3fa7650175f4b3e5bf8ed67a8f8a1930fd8dc18f3b config-baseline.json
2+
b58f16663413d37906072f3ed7fa7c0ed0bac6347ab76627180ea4f21331b9c5 config-baseline.core.json
3+
25c6e70d5b4925e07549072159ce4fcad45813fed12fa36a2f43d3568ca8dd96 config-baseline.channel.json
4+
af8a8e8616a0146ad989ff1bc0e8cf62c61a4d434dd67bbe7fe082c5c204fada config-baseline.plugin.json

‎docs/ci.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Keep `workflow_ref` and `package_ref` separate. `workflow_ref` is the trusted wo
258258
### Suite profiles
259259

260260
- `smoke` — `npm-onboard-channel-agent`, `gateway-network`, `config-reload`
261-
- `package` — `npm-onboard-channel-agent`, `doctor-switch`, `update-channel-switch`, `upgrade-survivor`, `published-upgrade-survivor`, `plugins-offline`, `plugin-update`
261+
- `package` — `npm-onboard-channel-agent`, `doctor-switch`, `update-channel-switch`, `skill-install`, `update-corrupt-plugin`, `upgrade-survivor`, `published-upgrade-survivor`, `update-restart-auth`, `plugins-offline`, `plugin-update`
262262
- `product` — `package` plus `mcp-channels`, `cron-mcp-cleanup`, `openai-web-search-minimal`, `openwebui`
263263
- `full` — full Docker release-path chunks with OpenWebUI
264264
- `custom` — exact `docker_lanes`; required when `suite_profile=custom`
@@ -269,7 +269,7 @@ For the dedicated update and plugin testing policy, including local commands,
269269
Docker lanes, Package Acceptance inputs, release defaults, and failure triage,
270270
see [Testing updates and plugins](/help/testing-updates-plugins).
271271

272-
Release checks call Package Acceptance with `source=artifact`, the prepared release package artifact, `suite_profile=custom`, `docker_lanes='doctor-switch update-channel-switch upgrade-survivor published-upgrade-survivor plugins-offline plugin-update'`, and `telegram_mode=mock-openai`. This keeps package migration, update, stale-plugin-dependency cleanup, configured-plugin install repair, offline plugin, plugin-update, and Telegram proof on the same resolved package tarball. Set `package_acceptance_package_spec` on Full Release Validation or OpenClaw Release Checks to run that same matrix against a shipped npm package instead of the SHA-built artifact. Cross-OS release checks still cover OS-specific onboarding, installer, and platform behavior; package/update product validation should start with Package Acceptance. The `published-upgrade-survivor` Docker lane validates one published package baseline per run in the blocking release path. In Package Acceptance, the resolved `package-under-test` tarball is always the candidate and `published_upgrade_survivor_baseline` selects the fallback published baseline, defaulting to `openclaw@latest`; failed-lane rerun commands preserve that baseline. Full Release Validation with `run_release_soak=true` or `release_profile=full` sets `published_upgrade_survivor_baselines='last-stable-4 2026.4.23 2026.5.2 2026.4.15'` and `published_upgrade_survivor_scenarios=reported-issues` to expand across the four latest stable npm releases plus pinned plugin-compatibility boundary releases and issue-shaped fixtures for Feishu config, preserved bootstrap/persona files, configured OpenClaw plugin installs, tilde log paths, and stale legacy plugin dependency roots. Multi-baseline published-upgrade survivor selections are sharded by baseline into separate targeted Docker runner jobs. The separate `Update Migration` workflow uses the `update-migration` Docker lane with `all-since-2026.4.23` and `plugin-deps-cleanup` when the question is exhaustive published update cleanup, not normal Full Release CI breadth. Local aggregate runs can pass exact package specs with `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS`, keep a single lane with `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPEC` such as `[email protected]`, or set `OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS` for the scenario matrix. The published lane configures the baseline with a baked `openclaw config set` command recipe, records recipe steps in `summary.json`, and probes `/healthz`, `/readyz`, plus RPC status after Gateway start. The Windows packaged and installer fresh lanes also verify that an installed package can import a browser-control override from a raw absolute Windows path. The OpenAI cross-OS agent-turn smoke defaults to `OPENCLAW_CROSS_OS_OPENAI_MODEL` when set, otherwise `openai/gpt-5.4`, so the install and gateway proof stays on a GPT-5 test model while avoiding GPT-4.x defaults.
272+
Release checks call Package Acceptance with `source=artifact`, the prepared release package artifact, `suite_profile=custom`, `docker_lanes='doctor-switch update-channel-switch skill-install update-corrupt-plugin upgrade-survivor published-upgrade-survivor update-restart-auth plugins-offline plugin-update'`, and `telegram_mode=mock-openai`. This keeps package migration, update, live ClawHub skill install, stale-plugin-dependency cleanup, configured-plugin install repair, offline plugin, plugin-update, and Telegram proof on the same resolved package tarball. Set `package_acceptance_package_spec` on Full Release Validation or OpenClaw Release Checks to run that same matrix against a shipped npm package instead of the SHA-built artifact. Cross-OS release checks still cover OS-specific onboarding, installer, and platform behavior; package/update product validation should start with Package Acceptance. The `published-upgrade-survivor` Docker lane validates one published package baseline per run in the blocking release path. In Package Acceptance, the resolved `package-under-test` tarball is always the candidate and `published_upgrade_survivor_baseline` selects the fallback published baseline, defaulting to `openclaw@latest`; failed-lane rerun commands preserve that baseline. Full Release Validation with `run_release_soak=true` or `release_profile=full` sets `published_upgrade_survivor_baselines='last-stable-4 2026.4.23 2026.5.2 2026.4.15'` and `published_upgrade_survivor_scenarios=reported-issues` to expand across the four latest stable npm releases plus pinned plugin-compatibility boundary releases and issue-shaped fixtures for Feishu config, preserved bootstrap/persona files, configured OpenClaw plugin installs, tilde log paths, and stale legacy plugin dependency roots. Multi-baseline published-upgrade survivor selections are sharded by baseline into separate targeted Docker runner jobs. The separate `Update Migration` workflow uses the `update-migration` Docker lane with `all-since-2026.4.23` and `plugin-deps-cleanup` when the question is exhaustive published update cleanup, not normal Full Release CI breadth. Local aggregate runs can pass exact package specs with `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPECS`, keep a single lane with `OPENCLAW_UPGRADE_SURVIVOR_BASELINE_SPEC` such as `[email protected]`, or set `OPENCLAW_UPGRADE_SURVIVOR_SCENARIOS` for the scenario matrix. The published lane configures the baseline with a baked `openclaw config set` command recipe, records recipe steps in `summary.json`, and probes `/healthz`, `/readyz`, plus RPC status after Gateway start. The Windows packaged and installer fresh lanes also verify that an installed package can import a browser-control override from a raw absolute Windows path. The OpenAI cross-OS agent-turn smoke defaults to `OPENCLAW_CROSS_OS_OPENAI_MODEL` when set, otherwise `openai/gpt-5.4`, so the install and gateway proof stays on a GPT-5 test model while avoiding GPT-4.x defaults.
273273

274274
### Legacy compatibility windows
275275

‎docs/gateway/configuration-examples.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ Save to `~/.openclaw/openclaw.json` and you can DM the bot from that number.
452452
install: {
453453
preferBrew: true,
454454
nodeManager: "npm", // npm | pnpm | yarn | bun
455+
allowUploadedArchives: false,
455456
},
456457
entries: {
457458
"image-lab": {

‎docs/gateway/configuration-reference.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ See [MCP](/cli/mcp#openclaw-as-an-mcp-client-registry) and
138138
install: {
139139
preferBrew: true,
140140
nodeManager: "npm", // npm | pnpm | yarn | bun
141+
allowUploadedArchives: false,
141142
},
142143
entries: {
143144
"image-lab": {
@@ -159,6 +160,10 @@ See [MCP](/cli/mcp#openclaw-as-an-mcp-client-registry) and
159160
available before falling back to other installer kinds.
160161
- `install.nodeManager`: node installer preference for `metadata.openclaw.install`
161162
specs (`npm` | `pnpm` | `yarn` | `bun`).
163+
- `install.allowUploadedArchives`: allow trusted `operator.admin` Gateway
164+
clients to install private zip archives staged through `skills.upload.*`
165+
(default: false). This only enables the uploaded-archive path; normal ClawHub
166+
installs do not require it.
162167
- `entries.<skillKey>.enabled: false` disables a skill even if bundled/installed.
163168
- `entries.<skillKey>.apiKey`: convenience for skills declaring a primary env var (plaintext string or SecretRef object).
164169

‎docs/gateway/protocol.md‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,28 @@ terminal summary, and sanitized error text.
570570
sanitized install options without exposing raw secret values.
571571
- Operators may call `skills.search` and `skills.detail` (`operator.read`) for
572572
ClawHub discovery metadata.
573-
- Operators may call `skills.install` (`operator.admin`) in two modes:
573+
- Operators may call `skills.upload.begin`, `skills.upload.chunk`, and
574+
`skills.upload.commit` (`operator.admin`) to stage a private skill archive
575+
before installing it. This is a separate admin upload path for trusted clients,
576+
not the normal ClawHub skill install flow, and is disabled by default unless
577+
`skills.install.allowUploadedArchives` is enabled.
578+
- `skills.upload.begin({ kind: "skill-archive", slug, sizeBytes, sha256?, force?, idempotencyKey? })`
579+
creates an upload bound to that slug and force value.
580+
- `skills.upload.chunk({ uploadId, offset, dataBase64 })` appends bytes at
581+
the exact decoded offset.
582+
- `skills.upload.commit({ uploadId, sha256? })` verifies the final size and
583+
SHA-256. Commit only finalizes the upload; it does not install the skill.
584+
- Uploaded skill archives are zip archives containing a `SKILL.md` root. The
585+
archive's internal directory name never selects the install target.
586+
- Operators may call `skills.install` (`operator.admin`) in three modes:
574587
- ClawHub mode: `{ source: "clawhub", slug, version?, force? }` installs a
575588
skill folder into the default agent workspace `skills/` directory.
589+
- Upload mode: `{ source: "upload", uploadId, slug, force?, sha256?, timeoutMs? }`
590+
installs a committed upload into the default agent workspace `skills/<slug>`
591+
directory. The slug and force value must match the original
592+
`skills.upload.begin` request. This mode is rejected unless
593+
`skills.install.allowUploadedArchives` is enabled. The setting does not
594+
affect ClawHub installs.
576595
- Gateway installer mode: `{ name, installId, dangerouslyForceUnsafeInstall?, timeoutMs? }`
577596
runs a declared `metadata.openclaw.install` action on the gateway host.
578597
- Operators may call `skills.update` (`operator.admin`) in two modes:

0 commit comments

Comments
 (0)