Skip to content

fix: preserve file operations with fs-safe 0.13.1 - #150263

Merged
steipete merged 9 commits into
mainfrom
codex/bump-fs-safe-0130-20260916
Sep 17, 2026
Merged

steipete merged 9 commits into
mainfrom
codex/bump-fs-safe-0130-20260916

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Adopts fs-safe 0.13.1 while keeping attachment staging, migration claims, Memory Wiki rollback, and completion installation working with native filesystem operations.

User Impact

Supported installations select the native helper automatically, so atomic moves preserve competing destinations and Worker-backed operations remain quiet during normal execution and error cleanup. Explicit native-mode settings and sealed workers' native-off policy remain honored.

Maintainer decision: retain atomic no-clobber semantics and accept the documented need for operator intervention when native support is disabled or absent. With effective native mode off, or a missing helper in auto, a no-clobber move to an absent destination rejects with helper-unavailable (native no-replace move is unavailable). Compiled-package tests verify unchanged source bytes and no destination file. An existing destination instead returns already-exists; these are separate outcomes.

Operator recovery: change the effective explicit override to auto or remove it, install OpenClaw with optional platform dependencies enabled on a supported runtime/filesystem, then restart and retry. Unsupported runtimes need a supported environment for these operations. No unsafe fallback or automatic mode override is added. The platform-defaults documentation records the modes, supported helpers, and refusal behavior.

The upstream descriptor fix covers normal and error closure; descriptor reclamation after forced Worker.terminate() remains unsupported.

Missing or unusable attachment names stay omitted, and media without a usable original basename retains its UUID-only storage key.

Why This Change Was Made

Pins all four consumers to the verified 0.13.1 release, including the native descriptor-ownership correction found during adoption. Removes both implicit native-off defaults and the write-error decorator now supplied by fs-safe. The generated lockfile retains exact native package edges; eight version-specific cooldown exceptions expire seven days after actual publication.

Fault-injection tests now observe guarded publication and Root operations, retaining collision, authority, cancellation, content, durability, and ownership-aware cleanup assertions. Linux staging replacements keep the original inode open so immediate reuse cannot defeat the intended identity race. Temp-root tests exercise the real secure resolver; diagnostic fixtures isolate logging from their mocked platform; Fish completion tests assert shell-quoted paths. No production logging or shell behavior changes were needed.

Main's OnePassword publication preparation, bundled-plugin deferrals, catalog entries, packaged IMAP regression, and current publisher-inventory equality checks remain intact.

Evidence

  • Exact-head CI passed on 6ed8ada97f4650410a297a8501fa409e62523b79: 161 successful jobs, 11 skipped, zero failures. Both Windows shards and the previously failing UI shard passed. UI source and assertions are unchanged.
  • Fresh Azure Windows validation used 16 logical CPUs on the same head/tree. The original diagnostic suite ran first and passed all nine cases; native child/Worker probes returned correct bytes, zero warnings, fully drained empty stderr, and successful exits. Completion write-state passed 23 cases with three existing platform skips; both changed Fish runtime cases and all 12 selected Gateway/Memory Wiki/SQLite/snapshot publication cases passed. No new skips or longer deadlines were introduced. All 32 bound source hashes and package/script hashes stayed unchanged.
  • All eight lockfile integrities match independently verified registry artifacts, signatures, and provenance. Frozen pnpm 12.4.0 installation passed with the complete hashed package-manager pin unchanged and no unrelated package records changed.
  • Local integration checks passed all typechecks/lint, 99 npm lock validations, and zero runtime import cycles. Focused consumer validation includes all 109 completion cases, all nine diagnostics, and 184 fixture followup tests, including repeated SQLite coverage. Earlier native/default, optional-name, transfer-authority, and packaged-worker checks also passed. Fresh P0–P2 reviews of the adoption, exact pins, fixture repairs, and main integration found no actionable findings.
  • The current CI's published-upgrade survivor passed legacy-operator-state with auto-auth in 335 seconds. The selected published baseline is OpenClaw 2026.9.3, whose registry metadata pins fs-safe 0.8.5; candidate installation output confirms fs-safe 0.13.1. This lane uses the published updater and real Gateway against existing state, with a systemctl fixture; individual successful inner assertions are not printed. Its successful upgrade covers a supported installation with the helper available. Disabled/missing-helper behavior is separately covered by the compiled-package refusal and source/destination-preservation tests described above.

@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime security Security documentation extensions: memory-wiki plugin: file-transfer extensions: openshell extensions: onepassword 1Password plugin size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 19:46
@steipete
steipete requested a review from a team as a code owner September 16, 2026 19:46
@steipete steipete self-assigned this Sep 16, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/file-transfer/package.json
  • extensions/onepassword/package.json
  • extensions/openshell/package.json
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of @openclaw/openclaw-secops, or an OpenClaw organization member with Maintain or Admin repository access.

  • Current SHA: 6ed8ada97f4650410a297a8501fa409e62523b79
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 16, 2026, 8:09 PM ET / September 17, 2026, 00:09 UTC (Revision 6).

ClawSweeper review

What this changes

Upgrades fs-safe to 0.13.1, enables automatic native filesystem helpers, preserves optional attachment filenames, and updates filesystem fault-injection tests and documentation.

Merge readiness

⛔ Blocked before merge - 2 items remain

This adoption remains useful and is absent from current main. No blocking patch defect was found; the updated maintainer decision resolves the previous compatibility-choice blocker, and both Windows CI lanes now pass on the reviewed head.

Priority: P2
Reviewed head: 6ed8ada97f4650410a297a8501fa409e62523b79

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent adoption with meaningful native and upgrade evidence, resolved prior concerns, and a clearly accepted compatibility tradeoff.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Recorded real macOS and Windows child/Worker operations exercise the adopted filesystem owner with correct bytes and quiet cleanup; published-driver upgrade evidence covers supported existing installations. Exact-head Windows CI supplements that proof, while unavailable-helper refusal remains an explicitly accepted limitation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded real macOS and Windows child/Worker operations exercise the adopted filesystem owner with correct bytes and quiet cleanup; published-driver upgrade evidence covers supported existing installations. Exact-head Windows CI supplements that proof, while unavailable-helper refusal remains an explicitly accepted limitation.
Evidence reviewed 11 items Pinned scope and clean checkout: Reviewed the introduced delta from the supplied merge base to the exact original head. The checkout remained clean and diff whitespace checks passed; the stale synthetic test merge was not used to attribute removals.
Adoption remains absent from main: Fetched main still pins fs-safe 0.12.0 and applies the implicit POSIX native-off default.
Latest release comparison: The latest supplied release, v2026.9.4, pins fs-safe 0.8.5 rather than the proposed 0.13.1.
Findings None None.
Security None None.

How this fits together

OpenClaw uses fs-safe to guard local file operations for attachments, memory, migrations, and other runtime services. It translates bounded filesystem requests into native or JavaScript operations while preserving path, identity, and publication checks.

flowchart TD
  A[Attachments and runtime files] --> B[OpenClaw filesystem adapters]
  B --> C[fs-safe policy and identity checks]
  D[Explicit native mode] --> C
  C --> E{Required primitive available?}
  E -->|Yes| F[Guarded filesystem operation]
  E -->|No| G[Documented fallback or refusal]
  F --> H[Published file or verified read]
Loading

Before merge

  • Resolve merge risk (P1) - Existing installations with native mode off, missing optional helpers, or unsupported native primitives lose no-clobber move workflows until operators restore supported native operation; the maintainer explicitly accepts this compatibility cost.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -74, Tests +391, Docs 0, Config +7, Other +7. Total +331 across 51 files.

View PR surface stats
Area Files Added Removed Net
Source 5 17 91 -74
Tests 37 1377 986 +391
Docs 2 9 9 0
Config 5 20 13 +7
Generated 0 0 0 0
Other 2 64 57 +7
Total 51 1487 1156 +331

Review metrics

Metric Value Why it matters
Native default 2 implicit native-off overrides removed; 0 new configuration knobs Core and memory operations now share the dependency's auto default while retaining explicit operator settings.

Stored data model

Persistent data-model change detected: migration/backfill/repair: pnpm-workspace.yaml, vector/embedding metadata: packages/memory-host-sdk/src/host/fs-utils.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the documented native requirement (recommended)
    Proceed under the recorded maintainer decision, preserving atomic no-clobber guarantees and the documented operator recovery for unavailable helpers.

Technical review

Best possible solution:

Keep atomic publication and configuration precedence owned by fs-safe, preserve caller-visible filenames, and retain the documented recovery path under the recorded compatibility decision.

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

No failing current-main runtime was executed during this read-only review; source inspection and the recorded native probes establish the relevant dependency behavior and adoption regressions.

Is this the best way to solve the issue?

Yes. Using the upstream configuration, atomic-move, and diagnostic owners removes duplicated policy while the targeted filename adaptations preserve existing behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a5be82716c08.

Labels

Label justifications:

  • P2: This is a bounded filesystem dependency adoption preserving established runtime operations.
  • merge-risk: 🚨 compatibility: No-clobber moves become unavailable for native-off or helperless installations, an explicitly accepted operator-facing change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded real macOS and Windows child/Worker operations exercise the adopted filesystem owner with correct bytes and quiet cleanup; published-driver upgrade evidence covers supported existing installations. Exact-head Windows CI supplements that proof, while unavailable-helper refusal remains an explicitly accepted limitation.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real macOS and Windows child/Worker operations exercise the adopted filesystem owner with correct bytes and quiet cleanup; published-driver upgrade evidence covers supported existing installations. Exact-head Windows CI supplements that proof, while unavailable-helper refusal remains an explicitly accepted limitation.

Evidence

What I checked:

  • Pinned scope and clean checkout: Reviewed the introduced delta from the supplied merge base to the exact original head. The checkout remained clean and diff whitespace checks passed; the stale synthetic test merge was not used to attribute removals. (6ed8ada97f46)
  • Adoption remains absent from main: Fetched main still pins fs-safe 0.12.0 and applies the implicit POSIX native-off default. (src/infra/fs-safe-defaults.ts:14, a5be82716c08)
  • Latest release comparison: The latest supplied release, v2026.9.4, pins fs-safe 0.8.5 rather than the proposed 0.13.1. (package.json, 3a9d69db306c)
  • Prior review disposition: The complete supplied body, under sourceRevision b58b60f496053fb0eeca9d886e195851020f06fc9b71eb19bac80956ecbdf913, explicitly accepts atomic no-clobber refusal without native support and documents operator recovery. A REST reread retained that decision and the same head. This resolves the prior request for a maintainer compatibility choice without requiring an unsafe fallback. (6ed8ada97f46)
  • Preserved filename behavior: The media-store fallback collapses to the existing UUID-only key, while Mattermost distinguishes unusable names from legitimate underscore and hyphen filenames. Added cases address the earlier optional-filename finding. (src/media/store.ts:108, 6ed8ada97f46)
  • Dependency contract directly inspected: OpenClaw directly imports this dependency and changes its runtime version and default selection. At the verified v0.13.1 commit, no-replace moves require the native primitive, reject collisions, recheck live mutation authority before dispatch, and retain descriptor-specific cleanup. This supports the documented refusal behavior. (src/root-move-noreplace.ts, 7022a0a10c53)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-16T19:54:46.006Z sha 6dd8edd :: blocked before merge. :: none
  • reviewed 2026-09-16T20:29:26.711Z sha 6dd8edd :: blocked before merge. :: [P2] [P2] Preserve absent optional filenames before upgrading the sanitizer
  • reviewed 2026-09-16T22:46:46.843Z sha 8076a9f :: blocked before merge. :: none
  • reviewed 2026-09-16T23:30:38.861Z sha 07ce578 :: blocked before merge. :: none
  • reviewed 2026-09-16T23:54:09.910Z sha 6ed8ada :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost scripts Repository scripts commands Command implementations agents Agent runtime and tooling fleet labels Sep 16, 2026
@steipete steipete changed the title fix: preserve file operations with fs-safe 0.13.0 fix: preserve file operations with fs-safe 0.13.1 Sep 16, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
Exercise the real secure-temp resolver for private-root creation and repair while preserving shared-parent permissions. Keep replaced staging inodes open through publication so Linux cannot immediately reuse their identities; retain the strict rejection and cleanup assertions.
Select an isolated log file while mocking the logical platform and restore the previous override through the logger owner. This keeps cold Windows runs from failing before the second port poll while preserving the existing environment and signal assertions.
Check the complete guarded Fish source block instead of searching for raw Windows paths. Preserve installation, idempotence, cache, and command-registration assertions, and verify a fixed Windows path against a literal quoted reload command.
Keep main’s canonical complete publisher-inventory equality checks when resolving the sole conflict. Preserve all remaining reviewed adoption files and all current-main changes.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 16, 2026
@steipete
steipete merged commit 6dbf187 into main Sep 17, 2026
242 of 243 checks passed
@steipete
steipete deleted the codex/bump-fs-safe-0130-20260916 branch September 17, 2026 00:21
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

fuller-stack-dev pushed a commit to LiuwqGit/openclaw that referenced this pull request Sep 17, 2026
Root reads in fs-safe 0.13.1 use dedicated final-admission hooks. Move the post-stat growth fixture to beforeRootReadFinalFence so its real read instrumentation and aggregate-budget assertions execute again.

Related: openclaw#150263.
steipete added a commit that referenced this pull request Sep 17, 2026
…150419)

Root reads in fs-safe 0.13.1 use dedicated final-admission hooks. Move the post-stat growth fixture to beforeRootReadFinalFence so its real read instrumentation and aggregate-budget assertions execute again.

Related: #150263.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
* fix: preserve file operations with fs-safe 0.13.0

* fix: preserve native filesystem consumer behavior

* build: adopt verified fs-safe 0.13.1 artifacts

* test: align release inventory with deferred plugins

* test: make temp permissions and staging swaps deterministic

Exercise the real secure-temp resolver for private-root creation and repair while preserving shared-parent permissions. Keep replaced staging inodes open through publication so Linux cannot immediately reuse their identities; retain the strict rejection and cleanup assertions.

* test: isolate logs in diagnostic environment fixtures

Select an isolated log file while mocking the logical platform and restore the previous override through the logger owner. This keeps cold Windows runs from failing before the second port poll while preserving the existing environment and signal assertions.

* test: assert Fish-quoted completion profile paths

Check the complete guarded Fish source block instead of searching for raw Windows paths. Preserve installation, idempotence, cache, and command-registration assertions, and verify a fixed Windows path against a literal quoted reload command.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…penclaw#150419)

Root reads in fs-safe 0.13.1 use dedicated final-admission hooks. Move the post-stat growth fixture to beforeRootReadFinalFence so its real read instrumentation and aggregate-budget assertions execute again.

Related: openclaw#150263.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: mattermost Channel integration: mattermost commands Command implementations dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation extensions: memory-wiki extensions: onepassword 1Password plugin extensions: openshell fleet gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: file-transfer proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security Security documentation size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant