Repository navigation
[Feat] Add upload archive install RPC - #74430
Conversation
Greptile SummaryThis PR adds a chunked-upload RPC (
Confidence Score: 3/5Safe 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 AIThis 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:
|
|
Codex review: needs real behavior proof before merge. Summary 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 Next step before merge Security Review detailsBest 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:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0aa0083fc8c2. |
There was a problem hiding this comment.
💡 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".
|
Codex review: needs maintainer review before merge. What this changes: This PR adds admin Gateway 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 detailsBest 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:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0519107bd3e2. |
097d86e to
b2b4200
Compare
|
@codex review |
|
Codex review: needs maintainer review before merge. What this changes: The PR adds operator-admin Gateway 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 detailsBest 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:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9f213354628f. |
|
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 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 detailsBest 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:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 3215ab6de5db. |
There was a problem hiding this comment.
💡 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".
|
@greptileai review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@greptile review |
|
@greptileai review |
|
Maintainer real behavior proof for pushed SHA Result: 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 |
|
Added a package-backed Docker proof for skill install and wired it into release validation. Changes pushed in 8c5eb5f8ff58a47b1e987652279b547de200ab76:
Real behavior proof from Testbox The lane installs the packed OpenClaw tarball in a bare Docker runner, keeps |
a625c9e to
f1b8680
Compare
There was a problem hiding this comment.
💡 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 () => { |
There was a problem hiding this comment.
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 👍 / 👎.
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
|
Follow-up landed in #80117: the release packaging entry added here required Thanks again for the original PR. For future packaging changes, the release-check required paths and |
* 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]>
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
* 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]>
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
* 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]>
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
Summary
skills.upload.begin/chunk/commitplusskills.installwithsource: "upload".skills.install.allowUploadedArchives; ClawHub installs remain the normal remote registry path.Shipped Behavior / New Behavior
openclaw skills install <slug>and Gatewayskills.install({ source: "clawhub", ... })install skills from ClawHub. Those paths stay enabled and unchanged.skills.install({ name, installId, ... })runs dependency installers declared by an already-present skill. That path stays enabled and unchanged.skills.upload.begin/chunk/commit, then install it withskills.install({ source: "upload", ... }). Only this new uploaded-archive path is gated.skills.install.allowUploadedArchivesis unset/false, so the new uploaded-archive path is unavailable unless an operator opts in.{ "skills": { "install": { "allowUploadedArchives": true } } }openclaw skills install <slug>/ ClawHub remains separate and works while upload archives are disabled.Release CI / Docker Proof
skill-install/pnpm test:docker:skill-install.package-update-core.Package Acceptancepackage/product profiles.bundled-channel-deps-compat plugins-offline skill-install.skills.install.allowUploadedArchives=false, resolves the current live ClawHub slug from search, installs viaopenclaw skills install, then verifiesSKILL.md,.clawhub/origin.json,.clawhub/lock.json, andskills 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:
Evidence after fix: terminal output from the Testbox Docker run:
Observed result after fix: the packed package installed
homeassistant-skillfrom ClawHub, verifiedSKILL.md,.clawhub/origin.json,.clawhub/lock.json, andskills info --json, and confirmedskills.install.allowUploadedArchives=falsedid not block ClawHub installs.What was not tested: Uploaded archives with
skills.install.allowUploadedArchives=truewere covered by Gateway/archive integration tests, not by this Docker lane.OPENCLAW_A2UI_SKIP_MISSING=1was 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 SHAca4e1787e62939c115f03f472750c02d0caf21f2.Bugs Found By The E2E
scripts/lib/bundled-runtime-deps-install.mjs, required by npm postinstall. Fixed inpackage.jsonfilesand the release pack guard.websocket-cached; fixed by typingSupportedTransportasAgentRuntimeTransport.Verification
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, anddocs/reference/RELEASING.mddocument the new Docker/release skill-install proof lane.