fix(import): delete GitHub skill blobs when import fails - #3612
Conversation
importGitHubSkillForUser stored Convex blobs before validating slug/owner/semver, and publish failures left those ids unreferenced. Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
|
🦞👀 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 11, 2026, 10:08 AM ET / 14:08 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR validates GitHub skill import metadata before storing files and deletes newly stored blobs when storage or publication fails, with three regression tests. Merge readiness⛔ Blocked before merge - 7 items remain This remains useful: current main and v0.23.3 still lack failed-import cleanup. The previous blocking finding remains unresolved, and the supplied in-memory demonstration does not satisfy the real Convex proof requirement. Priority: P2 Review scores
Verification
How this fits togetherClawHub imports selected files from a publisher’s public GitHub repository into Convex storage, then publishes a skill version referencing those files. Publication also schedules security scans and other follow-up work. flowchart TD
A[GitHub repository and selected files] --> B[Validate identity and metadata]
B --> C[Store file blobs]
C --> D[Commit skill version]
D --> E[Schedule follow-up work]
C -->|Failure| F[Import cleanup]
E -->|Failure propagates| F
F --> G[Delete recorded blobs]
Before merge
Findings
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. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make cleanup follow durable file ownership: delete only unclaimed import blobs and preserve files once a pending or published version owns them. Do we have a high-confidence way to reproduce the issue? Yes, source establishes both the current-main leak and the introduced failure path: commit a non-staged version, then let follow-up scheduling reject. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? No. Earlier validation is appropriate, but catching the entire publishing helper confuses failure with lack of commitment; cleanup must distinguish unclaimed files from files already persisted on a version. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cbfee7343ddc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
What Problem This Solves
Fixes an issue where users importing a GitHub skill would leave Convex storage blobs behind when the import failed. The GitHub import action stored each selected file, then checked slug, owner, display name, and version. An invalid version, a later store failure, or a publish failure never deleted those blobs. They were not attached to a skill version, so they stayed billed and unreferenced.
Why This Change Was Made
GitHub import now checks slug, owner, display name, and version before any
storage.store. Store and publish run inside one cleanup boundary. If store or publish fails, every stored id is deleted. A successful publish keeps the blobs.User Impact
Failed GitHub skill imports no longer leave orphaned upload blobs in Convex storage. Successful imports are unchanged.
Evidence
Live
bunon Windows 11, worktreeC:/Users/sebta/.grok/tmp/pr-gate-batch/clawhub-f006. The script calls productionimportGitHubSkillForUserwith in-memory storage and a local GitHub zip. Invalid version never stores. Publish failure storesstorage:1andstorage:2, then deletes both. A later store failure storesstorage:1and deletes it.Invalid version prints
storeCalls=-. Publish failure printsdeleteCalls=storage:1,storage:2. Mid-store failure printsdeleteCalls=storage:1.Real behavior proof
C:/Users/sebta/.grok/tmp/pr-gate-batch/clawhub-f006onfix/github-import-blob-cleanup. Proof imported productionimportGitHubSkillForUserfromconvex/githubImport.ts.bun C:/tmp/clawhub-f006-proof.mjs. The script imported a two-file GitHub zip through productionimportGitHubSkillForUserwith in-memory storage: invalid version, publish throw after store, and a later store throw after the first file.storeCalls=- deleteCalls=-. Publish failure printsstoreCalls=storage:1,storage:2 deleteCalls=storage:1,storage:2. Mid-store failure printsstoreCalls=storage:1 deleteCalls=storage:1.Notes
Same cleanup contract as skill-scan upload in
convex/httpApiV1/shared.tsanddeleteStoredGitHubSkillScanFilesinconvex/githubSkillSync.ts. Sibling multipart skill publish cleanup is PR #3549. This PR only changes GitHub import.Allow edits from maintainers is enabled.
Tracker
Ref #3672
That issue stays open if this PR is closed without landing on main.