fix: delete unpublished skill blobs when publish fails - #3549
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@SebTardif is attempting to deploy a commit to the OpenClaw Foundation Team on Vercel. A member of the Team first needs to authorize it. |
|
Codex review: needs real behavior proof before merge. Reviewed September 16, 2026, 1:22 AM ET / 05:22 UTC (Revision 76). ClawSweeper reviewWhat this changesDeletes unclaimed multipart skill uploads after failures while preserving files once a pending or published version owns them, with regression tests and a documented ownership invariant. Merge readiness⛔ Blocked before merge - 2 items remain This PR remains necessary: main and the latest release still leak failed multipart uploads. The previous persistence-boundary finding and spec omission are resolved, with no remaining blocking code findings; inspectable runtime evidence remains the merge gate. Priority: P2 Review scores
Verification
How this fits togetherClawHub’s publishing API stores uploaded skill files in Convex and attaches them to a version. Scanners and downloads subsequently read those files, so cleanup must stop when the version commits. flowchart TD
A[Authenticated multipart upload] --> B[Check sizes and store files]
B --> C[Validate publication]
C --> D[Commit skill version]
B -->|Failure| E[Delete request uploads]
C -->|Failure before commit| E
D --> F[Retain version files]
F --> G[Scans and downloads]
D --> H[Pending publication compensation]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep cleanup tied to request ownership until version persistence, with committed-file retention demonstrated by the existing native Convex run’s published evidence. Do we have a high-confidence way to reproduce the issue? Yes, source establishes a focused path: upload a multipart file with invalid publish metadata, then observe validation fail after storage without cleanup on main. This review did not execute that path. Is this the best way to solve the issue? Yes, this is the best code-level repair: transfer cleanup ownership at persistence, not helper completion. Earlier metadata validation alone misses later failures, and direct-upload ticket expiry does not cover multipart uploads. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against be87bfd9d3f8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (75 earlier review cycles; latest 8 shown)
|
Multipart POST /api/v1/skills stored each uploaded file, then parsed the payload. An invalid body, a later oversized file, or a 400 after parse (license reject, owner resolution) left Convex blobs unreferenced. Match parseMultipartSkillScan: reject oversized parts before store, delete stored ids if store or parse fails, and delete them when the handler returns 400 after a successful parse. Replayed onto upstream/main d3bde70. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Failed multipart skill publishes now delete request-owned uploads, including partial stores and failures before publication. Once a pending or published version commits, the publishing helper transfers ownership immediately, preserving its files through later scheduler or compensation failures. This completes Sebastien Tardif's existing parser cleanup and fixes the post-commit deletion finding.
Fixes #3670.
Native local Convex proof: invalid metadata, license refusal and rejected insertion went from two orphan blobs to zero; partial storage failure went from one to zero. The previous PR deleted both files after a post-commit scheduler failure (download 404); the repaired version retained both files (download 200, 989 and 43 bytes). Pending success, successful compensation, failed compensation and normal publication were also exercised using actual storage/version mutations and explicit fault injection. No production data or hosted deployment was used.
Validation: 522 focused tests; 6,972 full-suite tests passed; static, full types/build, explicit schema/CLI/Convex typechecks passed; structured repair review returned no findings.