Repository navigation
fix(fs): guard skill reads and bound worker bundle staging - #147336
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. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 4:33 PM ET / 20:33 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR bounds skill metadata and instruction reads, streams worker artifacts into guarded staging, and fixes port allocation in the TLS proof. Merge readiness⛔ Blocked before merge - 1 item remains The fix remains useful on current main, with no blocking introduced defect found. The updated compatibility explanation, unchanged writers, and live consumer results resolve the previous migration-proof concern. Priority: P2 Review scores
Verification
How this fits togetherSkill loading turns installed metadata and selected library revisions into agent instructions. Worker bundle preparation packages deployment files into a content-addressed archive for remote execution. flowchart TD
A[Installed skill metadata] --> C[Guarded bounded reads]
B[Selected library revisions] --> C
C --> D[Cached agent instructions]
E[Worker deployment files] --> F[Guarded staging copy]
F --> G[Staged file hashes]
G --> H[Worker archive]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +41, Tests +213. Total +254 across 7 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Use the existing filesystem safety owner while preserving valid artifacts, pinned session content, and worker archive identity. Do we have a high-confidence way to reproduce the issue? Yes, source establishes unbounded selected-instruction reads and a check-then-reopen metadata path on current main; focused regressions and supplied live results cover their repair. This review did not execute a reproduction. Is this the best way to solve the issue? Yes. Reusing published filesystem primitives is a narrow repair, and hashing the staged descriptor preserves archive identity without buffering whole artifacts or changing stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6fd88d996503. 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)
|
|
Merged via squash.
|
…1-prep * commit '912ae8d96e5964dfdcdf419b79613fb941cdf0a8': (350 commits) fix: keep workspace preparation responsive during cleanup (openclaw#147358) docs: alphabetize donors and sponsors and add Red Hat logo (openclaw#147302) fix(plugins): retain update authority through doctor effects (openclaw#144316) refactor(qa): share Multipass mount retry lifecycle (openclaw#147084) fix(memory): emit one JSON result for command failures (openclaw#147366) improve(plugins): speed up cold metadata loading (openclaw#147411) fix(sessions): avoid duplicate work after waited child replies (openclaw#147394) fix(agents): retain outstanding child results in parent context (openclaw#112623) test: preserve native workflow loader selection (openclaw#147403) fix: reduce repeated work while polling session pull requests (openclaw#147373) test(qa): preserve task cancellation across process replacement (openclaw#147382) fix: prevent sidebar refresh storms during session activity (openclaw#147400) refactor: simplify skills CLI formatting (openclaw#147368) fix: prevent Git checkout certificate failures behind egress proxy (openclaw#147410) fix(qa): stop live threads after their process leader exits (openclaw#147386) refactor(release): share agent turn retry lifecycle (openclaw#147076) fix(ui): keep uploaded images aligned with their prompts (openclaw#147389) fix(fs): guard skill reads and bound worker bundle staging (openclaw#147336) fix(ci): restore Linux service ownership fixtures (openclaw#147398) fix(plugins): preserve manifest permissions when building plugins (openclaw#147393) ...
…147336) * fix(fs): guard skill reads and bound worker bundle staging * test: allocate paired ports for TLS renewal proof
What Problem This Solves
Skill discovery can read beyond its checked metadata limits or follow a substituted file, while worker bundle preparation buffers each deploy artifact in full.
User Impact
Source-install metadata now stays within its existing 16 KiB limit, and pinned skill instructions enforce their existing 1 MiB artifact limit when first loaded. Valid aliases, source hardlinks, selected revision pins, batched metadata lookup, and cached content remain supported. Worker bundles retain their exact bytes, modes, and identities while staging with bounded memory.
Why This Change Was Made
Use published fs-safe 0.10 descriptor admission and bounded consumption for skill reads, and guarded exclusive copying followed by hashing the staged descriptor for bundle creation. Hashing the staged file adds a read pass; it avoids retaining a whole artifact buffer and keeps the archive and manifest tied to staged bytes. Copies explicitly retain the byte-copy strategy while the Linux offload fix awaits publication (openclaw/fs-safe#306).
The dependency pin, SQLite schema, cache lifecycle, worker retention, and release version are unchanged. New fs-safe API proposals are separate from this adoption.
No data migration is required: source-origin version 1, SQLite schema version 17, revision manifests and tree hashes, and worker bundle version 1 retain their existing formats and writers. The live CLI and library fixtures were produced through write owners unchanged from the PR base, then consumed by the new readers. The 16 KiB and 1 MiB limits also predate this change. This is compatibility evidence from unchanged writers and verified outputs; it is not a cross-version migration run.
Evidence
514d1e68d9f4repairs a CI collision in the existing TLS proof: Gateway and its lazy sandbox now use the shared allocator for both ports. The real TLS scenario, targeted changed-file checks, and independent P2 review pass. Production files remain byte-identical to the live-tested9c065bccommit below.9c065bcwith published fs-safe 0.10.0: an independently built CLI preserved the source-install key at 16,384 bytes, fell back at 16,385 bytes, and recovered after restoration. Runtime preparation accepted the exact 1 MiB library limit, rejected and recovered an oversized cold pin, and preserved the warm pinned hash after disk changes.Selected synthetic CLI and filesystem results
{ "source": "9c065bc2135d001523b9ce532842bd3f7c7e8cf0", "fsSafe": "0.10.0", "cliBuild": { "version": "2026.9.4", "commit": "9c065bc2135d001523b9ce532842bd3f7c7e8cf0", "builtAt": "2026-09-13T19:40:25.379Z", "buildId": "2026.9.4-9c065bc2135d-2026-09-13T19-40-25.379Z" }, "sourceOrigin": { "name": "cli-source-install-origin-limits", "status": "passed", "observations": [ { "case": "normal", "metadataBytes": 227, "skillKey": "fs-safe-source-installed" }, { "case": "boundary", "metadataBytes": 16384, "skillKey": "fs-safe-source-installed" }, { "case": "oversized", "metadataBytes": 16385, "skillKey": "fs-safe-source-display" }, { "case": "restored", "metadataBytes": 227, "skillKey": "fs-safe-source-installed" } ], "entrypoint": "skills install --as and fresh skills info processes", "gateway": "implicit local fallback; no Gateway started or contacted successfully" }, "consumerResults": [ { "name": "pinned-library-exact-cold-limit", "status": "passed", "bytes": 1048576, "hash": "2386c2e2ee382afe845339fd7bbf7a6ddbe373aeab2762df6ab4d153f573ff47", "consumer": "prepareWorkspaceSkills" }, { "name": "pinned-library-oversized-cold-read", "status": "passed", "oversizedBytes": 1048704, "rejected": true, "repairedSamePinLoaded": true, "failedReadCached": false }, { "name": "pinned-library-cache-preservation", "status": "passed", "hash": "8b66d2bbd3091963edd6b51d01a3e994add6d7a721c021e99920224670a79c75", "backingFileNowOversized": true, "equivalentPinRetainsMetadataHash": true }, { "name": "worker-bundle-large-hardlinked-source", "status": "passed", "workerBytes": 19573464, "sourceLinks": 2, "artifactCount": 3, "bundleHash": "7aff9a5aaba4c46aae3492997f48c5dc8eeef2d0428f1a4f0742d627d6f04cce", "tarballSha256": "79143e29218365506f1d319c28a3a30fd4dc91dddb711ef8ce9996e3ff5b11e0", "independentTarReader": "system tar", "outputMode": "0700", "repeatedPreparationStable": true }, { "name": "worker-bundle-source-rebuild-after-staging", "status": "passed", "observedBoundary": "temporary TAR file created after completed staging", "sourceChangedBeforePrepareResolved": true, "sourceHash": "4489e58714b08788cea2f9bfdfd98aaa8a40165b1ba928808fb947814cf571ac", "archivedWorkerHash": "2820bb7369d43ed2e9db766f79b3da3a4c41842210096e9fb0a42bdce828e5ba", "bundleHash": "7aff9a5aaba4c46aae3492997f48c5dc8eeef2d0428f1a4f0742d627d6f04cce", "matchesOriginalStagedManifest": true, "stagingResidue": false } ], "cleanup": { "syntheticState": "removed and independently verified absent", "leasesCreated": 0, "gatewayProcessesCreated": 0, "syntheticStateRemoved": true } }