Skip to content

[Feat] Add upload archive install RPC - #74430

Merged
steipete merged 15 commits into
openclaw:mainfrom
samzong:feat/skill-upload-rpc
May 10, 2026
Merged

steipete merged 15 commits into
openclaw:mainfrom
samzong:feat/skill-upload-rpc

Conversation

@samzong

@samzong samzong commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds an admin-gated Gateway path for private skill archive installs: skills.upload.begin/chunk/commit plus skills.install with source: "upload".
  • Keeps uploaded archive installs disabled by default behind skills.install.allowUploadedArchives; ClawHub installs remain the normal remote registry path.
  • Hardens archive installs with upload/install metadata binding, SHA/size checks, safe slug/path validation, archive-root validation, dangerous-code scanning for uploaded archives, per-upload locking, TTL/terminal cleanup, and rollback on failed replacement.
  • Adds package-backed Docker proof for live ClawHub skill install and wires it into release validation.

Shipped Behavior / New Behavior

  • Already shipped: openclaw skills install <slug> and Gateway skills.install({ source: "clawhub", ... }) install skills from ClawHub. Those paths stay enabled and unchanged.
  • Already shipped: Gateway skills.install({ name, installId, ... }) runs dependency installers declared by an already-present skill. That path stays enabled and unchanged.
  • New in this PR: Gateway clients can upload a private skill zip with skills.upload.begin/chunk/commit, then install it with skills.install({ source: "upload", ... }). Only this new uploaded-archive path is gated.
  • Default: skills.install.allowUploadedArchives is unset/false, so the new uploaded-archive path is unavailable unless an operator opts in.
  • Enable only for trusted admin clients:
{
  "skills": {
    "install": {
      "allowUploadedArchives": true
    }
  }
}
  • openclaw skills install <slug> / ClawHub remains separate and works while upload archives are disabled.

Release CI / Docker Proof

  • New lane: skill-install / pnpm test:docker:skill-install.
  • Added to Docker release-path chunk package-update-core.
  • Added to Package Acceptance package/product profiles.
  • Added to OpenClaw Release Checks custom package delta: bundled-channel-deps-compat plugins-offline skill-install.
  • The lane installs the packed OpenClaw tarball in a bare Docker runner, writes config with skills.install.allowUploadedArchives=false, resolves the current live ClawHub slug from search, installs via openclaw skills install, then verifies SKILL.md, .clawhub/origin.json, .clawhub/lock.json, and skills info --json.

Real behavior proof

Behavior or issue addressed: ClawHub skill install must still work from a packed OpenClaw package while the new uploaded-archive install path is disabled by default.

Real environment tested: Blacksmith Testbox Linux Docker runner using the PR branch package path and live ClawHub lookup.

Exact steps or command run after this patch:

OPENCLAW_TESTBOX=1 OPENCLAW_A2UI_SKIP_MISSING=1 OPENCLAW_DOCKER_ALL_LANES=skill-install pnpm test:docker:all

Evidence after fix: terminal output from the Testbox Docker run:

Docker test suite passed
E2E_OK installed=homeassistant-skill version=2.1.0 uploadArchives=false

Observed result after fix: the packed package installed homeassistant-skill from ClawHub, verified SKILL.md, .clawhub/origin.json, .clawhub/lock.json, and skills info --json, and confirmed skills.install.allowUploadedArchives=false did not block ClawHub installs.

What was not tested: Uploaded archives with skills.install.allowUploadedArchives=true were covered by Gateway/archive integration tests, not by this Docker lane.

OPENCLAW_A2UI_SKIP_MISSING=1 was only for the Testbox checkout, which did not include ignored/generated A2UI assets; this lane does not exercise Canvas. The final rebase reran targeted unit/integration coverage, config docs/schema checks, plugin SDK declaration typecheck, and Docker release-plan selection on head SHA ca4e1787e62939c115f03f472750c02d0caf21f2.

Bugs Found By The E2E

  • Packed tarball was missing scripts/lib/bundled-runtime-deps-install.mjs, required by npm postinstall. Fixed in package.json files and the release pack guard.
  • Plugin SDK declaration build had Pi transport type drift from websocket-cached; fixed by typing SupportedTransport as AgentRuntimeTransport.

Verification

pnpm test src/gateway/server-methods/skills-upload.test.ts src/gateway/server-methods/skills-upload-store.test.ts src/agents/skills-archive-install.test.ts src/agents/skills-clawhub.test.ts src/config/config.skills-entries-config.test.ts test/release-check.test.ts test/scripts/docker-e2e-plan.test.ts test/scripts/package-acceptance-workflow.test.ts
node scripts/run-tsgo.mjs -p tsconfig.plugin-sdk.dts.json --declaration true
git diff --check
pnpm config:schema:check
pnpm config:docs:check
OPENCLAW_DOCKER_ALL_LANES=skill-install node scripts/test-docker-all.mjs --plan-json
OPENCLAW_DOCKER_ALL_PROFILE=release-path OPENCLAW_DOCKER_ALL_CHUNK=package-update-core node scripts/test-docker-all.mjs --plan-json

Docs

  • docs/gateway/protocol.md, docs/tools/skills.md, docs/tools/skills-config.md, and generated config docs now state that uploaded archives are a separate trusted-admin path, off by default, and do not affect ClawHub installs.
  • docs/reference/test.md, docs/help/testing.md, docs/ci.md, and docs/reference/RELEASING.md document the new Docker/release skill-install proof lane.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling extensions: codex size: XL labels Apr 29, 2026
@greptile-apps

greptile-apps Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds a chunked-upload RPC (skills.upload.begin/chunk/commit) and a new source: "upload" variant to skills.install, enabling admin clients to stage and install private skill archives without going through ClawHub. The upload store is well-structured with per-upload locking, TTL cleanup, SHA-256 integrity checks, a declared-size cap, an active-upload limit, idempotency keys, and a dangerous-code scan enforced for uploaded archives.

  • The refactor of ensureSkillRoot into hasSkillArchiveRoot (checking only SKILL.md) is a breaking change for ClawHub installs on case-sensitive filesystems: the old helper also accepted skill.md, SKILL.MD, and skills.md, which are silently rejected after this change.

Confidence Score: 3/5

Safe to merge once the ClawHub SKILL.md case-variant regression is addressed or explicitly accepted as a breaking change.

One P1 finding: the removal of ensureSkillRoot's case-variant acceptance silently breaks ClawHub installs on Linux. The new upload feature itself is carefully guarded, but the refactor side-effect wasn't caught on macOS. A P1 caps confidence at 4, and the regression touching the existing ClawHub install path pulls it to 3.

src/agents/skills-clawhub.ts (SKILL.md variant regression), src/agents/skills-archive-install.ts (hasSkillArchiveRoot definition), src/gateway/server-methods/skills-upload-store.ts (idempotent commit path)

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/agents/skills-clawhub.ts
Line: 234-248

Comment:
**ClawHub install regression: lowercase `skill.md` variants no longer accepted**

The old `ensureSkillRoot` accepted `skill.md`, `skills.md`, and `SKILL.MD` as valid archive root markers before calling `installPackageDir`. The new `installExtractedSkillRoot` delegates to `hasSkillArchiveRoot`, which checks only `SKILL.md`. On case-sensitive filesystems (Linux), any ClawHub skill archive whose root contains `skill.md` or `SKILL.MD` (instead of exactly `SKILL.md`) will now fail with "archive is missing SKILL.md" — a silent breakage for existing ClawHub users that wasn't caught on macOS where the filesystem is case-insensitive.

Consider either adding the case variants back to `hasSkillArchiveRoot`, or explicitly documenting in a migration note that only `SKILL.md` (exact case) is now accepted and that existing archives must be updated.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/gateway/server-methods/skills-upload-store.ts
Line: 515-525

Comment:
**Idempotent `commit` may return `sha256: undefined` without error**

In the already-committed early-return path, `record.actualSha256` is typed as `string | undefined` on `SkillUploadRecord`. If a record is somehow persisted as `committed: true` but without `actualSha256` (e.g., disk corruption or a future code path), the response will include `sha256: undefined` serialized as `null` with no error signal. Adding a defensive throw keeps the contract consistent:
```typescript
if (record.committed) {
  if (!record.actualSha256) {
    throw new SkillUploadRequestError("committed upload is missing sha256");
  }
  ...
}
```

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: src/gateway/server-methods/skills-upload.ts
Line: 178-186

Comment:
**Fragile string-prefix error classification**

`error.startsWith("Invalid skill slug")` ties error-code routing to a human-readable string. If the message ever changes, this branch silently reclassifies to `UNAVAILABLE` instead of `INVALID_REQUEST`, changing client retry semantics without a compile-time warning. Same structural issue noted for `withExtractedArchiveRoot` in the PR's deferred items.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(skills): add upload archive install..." | Re-trigger Greptile

Re-review progress:

Comment thread src/agents/skills-clawhub.ts Resolved
@clawsweeper

clawsweeper Bot commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Summary
The PR adds config-gated Gateway skills.upload.begin/chunk/commit RPCs, skills.install upload-source support, shared skill archive install helpers, protocol/config/docs/Swift updates, and Docker release-path ClawHub skill-install proof.

Reproducibility: not applicable. this is a feature PR rather than a bug report. Current-main absence is source-verified by the handler, schema, config, docs search, and PR diff evidence.

Real behavior proof
Needs stronger real behavior proof before merge: The posted Testbox terminal proof covers live ClawHub install with uploaded archives disabled, but not the new upload RPC and upload-source install behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, ask a maintainer to comment @clawsweeper re-review.

Next step before merge
Needs maintainer/security review plus real upload-path proof; the remaining blocker is not a narrow automated code repair.

Security
Cleared: No concrete security or supply-chain defect was found in the inspected diff; the new upload install surface is admin-scoped, default-disabled, and guarded by validation, integrity checks, scanning, cleanup, and safe install paths.

Review details

Best possible solution:

Land the additive, default-disabled upload protocol only after redacted real upload/install proof and explicit maintainer/security acceptance of the archive install boundary.

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

Not applicable: this is a feature PR rather than a bug report. Current-main absence is source-verified by the handler, schema, config, docs search, and PR diff evidence.

Is this the best way to solve the issue?

Unclear for final merge: the default-disabled admin protocol and archive guards are a coherent direction, but a new code-install surface still needs maintainer/security sign-off and real upload-path proof.

Acceptance criteria:

  • Add redacted real Gateway proof for skills.upload.begin/chunk/commit followed by skills.install({ source: "upload" }).
  • After rebase, run pnpm test src/gateway/server-methods/skills-upload-store.test.ts src/gateway/server-methods/skills-upload.test.ts src/agents/skills-archive-install.test.ts src/agents/skills-clawhub.test.ts src/config/config.skills-entries-config.test.ts.
  • Run pnpm check:changed or the equivalent Testbox changed gate if it fans out broadly, keeping the package-backed Docker skill-install lane for release-path proof.

What I checked:

  • Current main lacks upload install handling: On current main, skills.install validates the existing schema, handles source: "clawhub", then falls back to gateway installer metadata; there is no source: "upload" branch, and targeted search found no skills.upload, SkillsUpload, or allowUploadedArchives implementation. (src/gateway/server-methods/skills.ts:176, 0aa0083fc8c2)
  • Current main schema has only existing install shapes: SkillsInstallParamsSchema on current main contains the gateway installer shape and the ClawHub shape only; upload begin/chunk/commit schemas are absent. (src/gateway/protocol/schema/agents-models-skills.ts:230, 0aa0083fc8c2)
  • PR head adds the upload RPC surface: The PR head spreads skillsUploadHandlers into skillsHandlers and adds the source: "upload" install branch calling installUploadedSkillArchive. (src/gateway/server-methods/skills.ts:70, a625c9ebf20c)
  • PR head gates uploaded archive RPCs: The new upload handlers reject begin/chunk/commit unless skills.install.allowUploadedArchives is enabled, and upload install also checks the gate before reading committed uploads. (src/gateway/server-methods/skills-upload.ts:97, a625c9ebf20c)
  • PR head includes upload integrity and lifecycle guards: The upload store validates slug, size, upload id, base64 chunk size, SHA-256, TTL, active-upload limit, idempotency conflicts, committed SHA state, and per-upload locking. (src/gateway/server-methods/skills-upload-store.ts:367, a625c9ebf20c)
  • Unit coverage exercises upload install behavior: The PR adds handler tests for disabled config, upload/chunk/commit/install cleanup, slug/force binding, SHA mismatch, expired uploads, missing SKILL.md, traversal rejection, scan blocks, force replacement, and rollback. (src/gateway/server-methods/skills-upload.test.ts:221, a625c9ebf20c)

Likely related people:

  • steipete: Current-main history for skills-clawhub.ts, skills.ts, and protocol schema includes native ClawHub install flows, archive install restoration, and dangerous skill-install scan hardening on this surface. (role: original ClawHub/native install owner and recent Gateway/security maintainer; confidence: high; commits: 91b2800241c1, 04b283ffc2d2, 0d7f1e2c84ec; files: src/agents/skills-clawhub.ts, src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts)
  • samzong: Beyond authoring this PR, current-main history shows prior merged work on ClawHub skill search/detail and nearby Gateway protocol/schema/scope wiring. (role: adjacent Gateway skills contributor; confidence: medium; commits: 37ab4b7fdc91, 0f0a192ecbbe, 450607847b7b; files: src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts, src/gateway/method-scopes.ts)
  • odysseus0: Recent current-main history includes ClawHub plugin publishing/install hardening adjacent to the archive install helper and compatibility surface touched here. (role: adjacent ClawHub hardening contributor; confidence: medium; commits: e133924047d2; files: src/agents/skills-clawhub.ts)

Remaining risk / open question:

  • No inspected real Gateway proof exercises the new skills.upload.begin/chunk/commit plus skills.install({ source: "upload" }) flow.
  • The PR expands trusted admin clients into local archive code installation, so maintainer/security acceptance remains a product decision even though the inspected guards look coherent.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0aa0083fc8c2.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76446ba1fe

ℹ️ 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".

Comment thread src/agents/skills-archive-install.ts Resolved
@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes:

This PR adds admin Gateway skills.upload.begin/chunk/commit methods, a skills.install upload source, durable upload storage, shared skill archive install helpers, docs, and focused handler/store tests.

Maintainer follow-up before merge:

This is an open XL feature PR touching a security-sensitive admin RPC and local archive install path; the next action is human maintainer/security review plus rebase and validation, not an automated repair PR.

Review details

Best possible solution:

Land this only as an additive Gateway protocol feature after maintainer/security review confirms the upload lifecycle, schema/docs/client contract, archive validation, dangerous-code scanning, cleanup/rollback behavior, and compatibility with existing ClawHub skill install protections.

Acceptance criteria:

  • pnpm test src/gateway/server-methods/skills-upload-store.test.ts src/gateway/server-methods/skills-upload.test.ts src/gateway/server-methods/skills.clawhub.test.ts src/gateway/server-methods/skills.search-detail.test.ts src/gateway/server-methods/skills.update.normalizes-api-key.test.ts src/agents/skills-clawhub.test.ts
  • pnpm check:changed

What I checked:

  • Current main lacks upload install handling: skills.install on current main validates the existing schema, handles only source: "clawhub", then falls back to gateway installer metadata; there is no source: "upload" branch. (src/gateway/server-methods/skills.ts:176, 0519107bd3e2)
  • Current protocol schema has only two install shapes: SkillsInstallParamsSchema currently contains the gateway installer object and the ClawHub object only; there are no SkillsUpload* schemas on main. (src/gateway/protocol/schema/agents-models-skills.ts:228, 0519107bd3e2)
  • Upload RPC methods are not registered or scoped on main: The server method list and admin scope include skills.install and skills.update, but not skills.upload.begin, skills.upload.chunk, or skills.upload.commit. (src/gateway/method-scopes.ts:166, 0519107bd3e2)
  • Current public docs still describe two install modes: The Gateway protocol docs on main describe skills.install as having only ClawHub and gateway installer modes, with no upload staging flow. Public docs: docs/gateway/protocol.md. (docs/gateway/protocol.md:510, 0519107bd3e2)
  • Targeted main search found no upload RPC implementation: Searches for skills.upload, source: "upload", SkillsUpload, uploadId, and related private archive upload terms found no implementation in the current Gateway, agents, or relevant docs paths. (0519107bd3e2)
  • Latest PR diff adds the intended protocol and handler surface: The PR diff adds upload handlers, a durable upload store, upload-backed install handling, protocol schemas, method registration/scope entries, docs, and tests. (src/gateway/server-methods/skills-upload.ts:61, 097d86e2d443)

Likely related people:

  • steipete: History for src/agents/skills-clawhub.ts, Gateway skills handlers, protocol schemas, and security scanning shows Peter introduced native ClawHub install flows, restored archive install behavior, and recently maintained Gateway/security-adjacent code. (role: recent maintainer and original ClawHub/native install owner; confidence: high; commits: 91b2800241c1, 04b283ffc2d2, 0d7f1e2c84ec; files: src/agents/skills-clawhub.ts, src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts)
  • samzong: Beyond authoring this PR, Sam has merged current-main work on the nearby Gateway skills search/detail RPC and Control UI skill browsing surface, which overlaps the protocol, handler, scope, docs, and skill install workflow touched here. (role: adjacent Gateway skills contributor; confidence: medium; commits: 37ab4b7fdc91, 0f0a192ecbbe, 450607847b7b; files: src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts, src/gateway/method-scopes.ts)
  • odysseus0: Recent current-main history for src/agents/skills-clawhub.ts includes ClawHub plugin publishing/install hardening, which is adjacent to the archive install helper refactor and compatibility concerns in this PR. (role: adjacent ClawHub hardening contributor; confidence: medium; commits: e133924047d2; files: src/agents/skills-clawhub.ts)

Remaining risk / open question:

  • The PR expands an admin Gateway API into staged private archive upload and local skill-code installation, so archive integrity, scan enforcement, path safety, cleanup, rollback, and client retry semantics need explicit maintainer/security review.
  • The provided PR metadata reports mergeable: false, so the branch needs rebase or conflict resolution before merge consideration.
  • No tests were run in this read-only review. The PR body reports focused tests and pnpm check:changed, but maintainers should refresh validation after rebase.
  • Failure classification still has some string/error-shape coupling around invalid slug and extraction errors; this looks bounded after the latest diff, but it is a reasonable follow-up area for maintainer judgment.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0519107bd3e2.

@samzong

samzong commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@codex review
@greptileai review

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes:

The PR adds operator-admin Gateway skills.upload.begin/chunk/commit, skills.install upload-source support, durable upload storage, shared skill archive install helpers, docs, and focused tests for private skill archive upload/install.

Maintainer follow-up before merge:

This is an open XL feature PR that widens the Gateway admin API and local code-install surface; the appropriate next action is maintainer/security review plus CI/Testbox validation, not an automated repair PR.

Review details

Best possible solution:

Land this only as an additive Gateway protocol feature after maintainer/security review confirms the upload API, schema/docs contract, storage lifecycle, archive validation, scan behavior, rollback/cleanup behavior, and compatibility with existing ClawHub install protections.

Acceptance criteria:

  • pnpm test src/gateway/server-methods/skills-upload-store.test.ts src/gateway/server-methods/skills-upload.test.ts src/gateway/server-methods/skills.clawhub.test.ts src/gateway/server-methods/skills.search-detail.test.ts src/gateway/server-methods/skills.update.normalizes-api-key.test.ts src/agents/skills-clawhub.test.ts
  • pnpm check:changed

What I checked:

  • Current main lacks upload install handling: skills.install on current main validates the existing install schema, handles source: "clawhub", then falls back to gateway installer metadata; there is no source: "upload" branch or upload-handler spread. (src/gateway/server-methods/skills.ts:176, b53ec93ed9d3)
  • Current main schema has only two install shapes: SkillsInstallParamsSchema currently contains the gateway installer object and the ClawHub object only; upload params and SkillsUpload* schemas are absent on main. (src/gateway/protocol/schema/agents-models-skills.ts:228, b53ec93ed9d3)
  • Current main does not scope upload methods: The admin scope includes skills.install and skills.update, but not skills.upload.begin, skills.upload.chunk, or skills.upload.commit. (src/gateway/method-scopes.ts:166, b53ec93ed9d3)
  • Current docs describe only existing install modes: The public Gateway protocol docs on main describe skills.install as having two modes, ClawHub and gateway installer metadata, with no private upload staging flow. Public docs: docs/gateway/protocol.md. (docs/gateway/protocol.md:510, b53ec93ed9d3)
  • Targeted main search found no upload RPC implementation: Searches for skills.upload, source: "upload", SkillsUpload, and uploadId across the relevant Gateway, agent, and docs paths found no current-main implementation. (b53ec93ed9d3)
  • PR branch adds the upload RPC surface: The latest PR head adds upload param schemas, upload methods to the server method list and admin scope, and an upload branch in skills.install. (src/gateway/server-methods/skills.ts:223, b2b42006ee98)

Likely related people:

  • steipete: Feature history for the current ClawHub install path and skill-install safety includes native ClawHub install flows, archive install restoration, dangerous skill-install scan hardening, and recent Gateway/protocol maintenance. (role: original ClawHub/native install owner and recent Gateway/security maintainer; confidence: high; commits: 91b2800241c1, 04b283ffc2d2, 0d7f1e2c84ec; files: src/agents/skills-clawhub.ts, src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts)
  • samzong: Besides this PR, current-main history shows prior merged work adding ClawHub skill search/detail Gateway RPCs, related protocol/schema/scope wiring, and nearby Gateway server-method changes. (role: adjacent Gateway skills contributor; confidence: medium; commits: 37ab4b7fdc91, 0f0a192ecbbe, 450607847b7b; files: src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts, src/gateway/method-scopes.ts)
  • odysseus0: Recent current-main history includes ClawHub plugin publishing/install hardening, adjacent to the archive install helper and compatibility surface refactored by this PR. (role: adjacent ClawHub hardening contributor; confidence: medium; commits: e133924047d2; files: src/agents/skills-clawhub.ts)

Remaining risk / open question:

  • The PR expands operator.admin into staged private archive upload and local skill code installation, so maintainers should explicitly review upload lifecycle, archive integrity, dangerous-code scan behavior, path safety, cleanup/rollback semantics, and client contract before merge.
  • This review was read-only and did not rerun the PR's targeted tests or changed gate; the PR body reports focused tests and pnpm check:changed, but CI/Testbox proof should be refreshed before landing.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 9f213354628f.

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes:

The PR adds operator-admin Gateway skill archive upload begin/chunk/commit RPCs, upload-backed skills.install, durable upload storage, shared archive install helpers, docs, and focused handler/store tests.

Maintainer follow-up before merge:

This is an open XL feature PR that changes a security-sensitive Gateway admin RPC and local code-install path; the next action is maintainer/security review plus validation, not an automated repair PR.

Review details

Best possible solution:

Land this only as an additive Gateway protocol feature after maintainer/security review confirms the upload lifecycle, schema/docs/client contract, archive validation, scan behavior, rollback/cleanup behavior, and compatibility with existing ClawHub skill install protections.

Acceptance criteria:

  • pnpm test src/gateway/server-methods/skills-upload-store.test.ts src/gateway/server-methods/skills-upload.test.ts src/gateway/server-methods/skills.clawhub.test.ts src/gateway/server-methods/skills.search-detail.test.ts src/gateway/server-methods/skills.update.normalizes-api-key.test.ts src/agents/skills-clawhub.test.ts
  • pnpm check:changed

What I checked:

  • Current main lacks upload install handling: skills.install on current main validates the existing install schema, handles source: "clawhub", then falls back to gateway installer metadata; there is no source: "upload" branch or upload handler spread. (src/gateway/server-methods/skills.ts:176, 3215ab6de5db)
  • Current main install schema has only existing shapes: SkillsInstallParamsSchema on current main contains the gateway installer object and ClawHub object only; upload params are absent. (src/gateway/protocol/schema/agents-models-skills.ts:228, 3215ab6de5db)
  • Current main search found no upload RPC implementation: Searches for skills.upload, source: "upload", SkillsUpload, and uploadId found no implementation in current src/gateway, src/agents, src/infra, or relevant docs paths. (3215ab6de5db)
  • PR branch adds upload methods and install branch: The PR head spreads skillsUploadHandlers into skillsHandlers and adds a source: "upload" branch that calls installUploadedSkillArchive. (src/gateway/server-methods/skills.ts:70, b2b42006ee98)
  • PR branch scopes upload methods as admin: The new upload methods are registered in the server method list and placed under operator.admin, matching the PR's stated security boundary. (src/gateway/method-scopes.ts:172, b2b42006ee98)
  • Upload store includes integrity and cleanup guards: The PR upload store validates slug, size, uploadId, SHA-256, base64 chunk size, TTL, active-upload limits, committed-record SHA state, and per-upload locking. (src/gateway/server-methods/skills-upload-store.ts:121, b2b42006ee98)

Likely related people:

  • steipete: GitHub commit history for the relevant paths shows native ClawHub install flows, restored archive install handling, dangerous skill-install scan hardening, and recent Gateway/protocol maintenance tied to this surface. (role: original ClawHub/native install owner and recent Gateway/security maintainer; confidence: high; commits: 91b2800241c1, 04b283ffc2d2, 0d7f1e2c84ec; files: src/agents/skills-clawhub.ts, src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts)
  • samzong: Beyond authoring this PR, current-main history includes prior merged work on ClawHub skill search/detail Gateway RPCs and nearby Gateway protocol/schema/scope wiring. (role: adjacent Gateway skills contributor; confidence: medium; commits: 37ab4b7fdc91, 0f0a192ecbbe, 450607847b7b; files: src/gateway/server-methods/skills.ts, src/gateway/protocol/schema/agents-models-skills.ts, src/gateway/method-scopes.ts)
  • odysseus0: Recent current-main history includes ClawHub plugin publishing/install hardening adjacent to the archive install helper and compatibility surface refactored here. (role: adjacent ClawHub hardening contributor; confidence: medium; commits: e133924047d2; files: src/agents/skills-clawhub.ts)

Remaining risk / open question:

  • The PR widens operator.admin into staged private archive upload and local skill code installation, so archive integrity, dangerous-code scan behavior, rollback, cleanup, retry semantics, and target path safety need explicit maintainer/security review.
  • The read-only review did not run the PR's test plan or changed-worktree gate; the PR body reports focused tests and pnpm check:changed passed, but CI/Testbox proof should be reviewed before merge.
  • First-party native clients with hard-coded Gateway method enums are not updated in this branch; maintainers should confirm whether this RPC-only change is intentionally server/API-only for now.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 3215ab6de5db.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2b42006ee

ℹ️ 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".

Comment thread src/agents/skills-archive-install.ts Resolved
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Apr 29, 2026
@samzong

samzong commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@greptileai review
@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@samzong

samzong commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@greptile review

@samzong

samzong commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai review

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 9, 2026
@steipete

steipete commented May 9, 2026

Copy link
Copy Markdown
Contributor

Maintainer real behavior proof for pushed SHA 70488fc2ff613892e0d30674db09500984f6d373:

blacksmith testbox warmup ci-check-testbox.yml --ref main --idle-timeout 90
pnpm testbox:claim --id tbx_01kr7f85hna176gx8n932djvxk
pnpm testbox:run --id tbx_01kr7f85hna176gx8n932djvxk -- '<fresh OPENCLAW_HOME; skills.install.allowUploadedArchives=false; pnpm openclaw skills search homeassistant --limit 3 --json; pnpm openclaw skills install homeassistant-skill --force; verify SKILL.md, .clawhub/origin.json, .clawhub/lock.json, and skills info JSON>'
blacksmith testbox stop --id tbx_01kr7f85hna176gx8n932djvxk

Result:

Downloading [email protected] from ClawHub...
Installing to /tmp/.../home/.openclaw/workspace/skills/homeassistant-skill...
Installed [email protected] -> /tmp/.../home/.openclaw/workspace/skills/homeassistant-skill
E2E_OK installed=homeassistant-skill uploadArchives=false

This proves the ClawHub skill install path still works while the new private upload archive install surface is disabled by config. Live ClawHub currently returns homeassistant-skill; the older docs slug homeassistant now returns 404.

@steipete
steipete requested a review from a team as a code owner May 9, 2026 23:23
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts docker Docker and sandbox tooling labels May 9, 2026
@steipete

steipete commented May 9, 2026

Copy link
Copy Markdown
Contributor

Added a package-backed Docker proof for skill install and wired it into release validation.

Changes pushed in 8c5eb5f8ff58a47b1e987652279b547de200ab76:

  • new Docker lane: skill-install / pnpm test:docker:skill-install
  • release-path coverage: package-update-core now includes skill-install
  • Full Release CI Package Acceptance custom lanes now include skill-install
  • package tarball guard now ships scripts/lib/bundled-runtime-deps-install.mjs, which the Docker proof caught as required for npm postinstall
  • future proof docs/skills updated to prefer this lane instead of inline Testbox heredocs

Real behavior proof from Testbox tbx_01kr7g6wyd1ps39txs04fj847y:

OPENCLAW_TESTBOX=1 OPENCLAW_A2UI_SKIP_MISSING=1 OPENCLAW_DOCKER_ALL_LANES=skill-install pnpm test:docker:all
Docker test suite passed
E2E_OK installed=homeassistant-skill version=2.1.0 uploadArchives=false

The lane installs the packed OpenClaw tarball in a bare Docker runner, keeps skills.install.allowUploadedArchives=false, resolves the current live ClawHub slug via openclaw skills search homeassistant --json, installs through openclaw skills install, then verifies SKILL.md, .clawhub/origin.json, .clawhub/lock.json, and skills info --json.

@openclaw-barnacle openclaw-barnacle Bot added triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup. triage: external-plugin-candidate Candidate: plugin/capability may belong on ClawHub. labels May 9, 2026
@steipete
steipete force-pushed the feat/skill-upload-rpc branch from a625c9e to f1b8680 Compare May 10, 2026 00:27
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed app: macos App: macos triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 10, 2026
@steipete
steipete merged commit d832ad2 into openclaw:main May 10, 2026
113 of 118 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ca4e1787e6

ℹ️ 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".

if (uploadId === excludeUploadId) {
continue;
}
await withLock(`${rootDir}:upload:${uploadId}`, async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip locked uploads during expiration sweep

cleanupExpiredUploads waits on every per-upload lock before it can continue, and both begin and chunk call this sweep on the request path. If one skills.install is in progress (holding withCommittedUpload’s lock), unrelated upload requests block until that install completes, which can stall or time out parallel uploads even though they target different uploadIds.

Useful? React with 👍 / 👎.

steipete added a commit that referenced this pull request May 10, 2026
Remove the nonexistent bundled runtime deps installer path from release packaging requirements and package files.\n\nThe original #74430 change was wrong because it required scripts/lib/bundled-runtime-deps-install.mjs without adding or generating that file, making npm pack validation impossible to satisfy.\n\nVerification:\n- pnpm test test/release-check.test.ts\n- package-files existence guard\n- Testbox tbx_01kr87j7wet04hw8v90htssege: pnpm build && pnpm ui:build && pnpm release:check
@steipete

Copy link
Copy Markdown
Contributor

Follow-up landed in #80117: the release packaging entry added here required scripts/lib/bundled-runtime-deps-install.mjs, but that file was not present in the repo and was not generated by build. Because the same missing path was also added to package.json#files, npm pack validation could never satisfy the requirement.

Thanks again for the original PR. For future packaging changes, the release-check required paths and package.json#files entries need to match files that exist after the documented build/prep sequence.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
Remove the nonexistent bundled runtime deps installer path from release packaging requirements and package files.\n\nThe original openclaw#74430 change was wrong because it required scripts/lib/bundled-runtime-deps-install.mjs without adding or generating that file, making npm pack validation impossible to satisfy.\n\nVerification:\n- pnpm test test/release-check.test.ts\n- package-files existence guard\n- Testbox tbx_01kr87j7wet04hw8v90htssege: pnpm build && pnpm ui:build && pnpm release:check
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* 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]>
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
Remove the nonexistent bundled runtime deps installer path from release packaging requirements and package files.\n\nThe original openclaw#74430 change was wrong because it required scripts/lib/bundled-runtime-deps-install.mjs without adding or generating that file, making npm pack validation impossible to satisfy.\n\nVerification:\n- pnpm test test/release-check.test.ts\n- package-files existence guard\n- Testbox tbx_01kr87j7wet04hw8v90htssege: pnpm build && pnpm ui:build && pnpm release:check
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* 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]>
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
Remove the nonexistent bundled runtime deps installer path from release packaging requirements and package files.\n\nThe original openclaw#74430 change was wrong because it required scripts/lib/bundled-runtime-deps-install.mjs without adding or generating that file, making npm pack validation impossible to satisfy.\n\nVerification:\n- pnpm test test/release-check.test.ts\n- package-files existence guard\n- Testbox tbx_01kr87j7wet04hw8v90htssege: pnpm build && pnpm ui:build && pnpm release:check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui docker Docker and sandbox tooling docs Improvements or additions to documentation gateway Gateway runtime proof: supplied External PR includes structured after-fix real behavior proof. scripts Repository scripts size: XL triage: dirty-candidate Candidate: broad unrelated surfaces; may need splitting or cleanup. triage: external-plugin-candidate Candidate: plugin/capability may belong on ClawHub. triage: refactor-only Candidate: refactor/cleanup-only PR without maintainer context.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants