Skip to content

fix(memory): preserve native read permission errors - #188531

Merged
roboclaw-bot merged 1 commit into
mainfrom
main-ci/memory-native-permission-20261030
Oct 30, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
main-ci/memory-native-permission-20261030

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by @steipete.

Work sessions

Discussion, implementation and verification

What Problem This Solves

Fixes memory file reads returning an fs-safe wrapper instead of the original permission error for an inaccessible Markdown file.

User Impact

Memory readers retain scoped EACCES/EPERM diagnostics and the existing path authorization rules.

Why This Change Was Made

fs-safe 0.26.14 intentionally wraps traversal permission failures as permission-denied and retains the native error in cause. Extend the memory reader's existing cause normalization to preserve its shipped error contract. The existing error-scoping regression also covers EPERM and checks original error identity.

The dependency update is #188352; the scoped memory-read contract is #139402.

Evidence

  • Original CI signature: scheduled run 41071928241, job 124118722041.
  • Expanded owning regression fails on EACCES and EPERM before the fix, then passes all 19 cases. Exact code/message, original error identity, healthy later roots, glob and symlink denials remain asserted.
  • Five focused memory reader and safe-read sibling files pass 86 distinct cases, including replaced-root identity and transient-read handling (--maxWorkers=1). Final owning-file run: 0.95 s; five-file wrapper: 41.94 s, mostly module/worker preparation. Hosted CI completed successfully in run 41092510722 on the exact source head.
  • Scoped typecheck, typed lint, formatting, unchanged test-line ceiling, and patch forward/reverse checks pass.
  • Independent isolated Codex autoreview of the complete two-file change against 6614c50b2de7 is scoped-clean through P2; no findings. Parent review accepted the same patch.
  • Exact-head dependency and security-sensitive review passed.
  • Limit: no live Gateway/OS-permission E2E or complete scheduled-main job replay. The boundary proof uses real fs-safe traversal with controlled native filesystem failures.

Co-authored-by: steipete [email protected]

Normalize fs-safe permission-denied causes through the existing memory
read adapter so scoped EACCES/EPERM diagnostics retain their shipped shape.

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 30, 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.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 30, 2026 16:43
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The memory reader unwraps fs-safe permission failures to preserve the original native error.

Example: Reading an allowed extra-memory file at /notes/blocked.md fails with EACCES during traversal.

  • Before: The reader returns fs-safe's permission-denied wrapper.
  • After: The reader preserves the original EACCES error, including its message and identity.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with useful owner-boundary regressions; proof remains limited to reported in-process execution.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate does not apply to this collaborator-authored bot PR; supplied evidence exercises the shared reader and real fs-safe traversal with injected filesystem failures, without a live Gateway permission run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An inaccessible allowed memory file returns a wrapper instead of its original native permission diagnostic.
Reason: The maintainer-authored change restores an established contract with a focused adjustment to the existing owner.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR restores an existing diagnostic contract still broken on main, and no actionable patch defect was found.

Priority: P2
Reviewed head: f4bee2899294a5cbc410b101680e3a4aee9e7393

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No current-patch Gateway memory_get run with real OS permission denial is supplied; base-red/head-green owner regressions are reported.
Agent review details

How this fits together

The shared memory reader receives workspace configuration and a requested Markdown path, delegates confined reads to fs-safe, and returns excerpts or errors consumed by memory_get and remote workspace readers.

flowchart TD
  A[Memory get or remote reader] --> B[Shared memory reader]
  B --> C[Workspace and extra path admission]
  C --> D[Confined fs safe read]
  D --> E[Native error normalization]
  D --> F[Bounded memory excerpt]
  E --> G[Caller error result]
  F --> G
Loading

Technical review

Best possible solution:

Extend the existing memory-reader error adapter while preserving confined reads, relevant-root selection, and native error identity.

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

Current-main normalization excludes the dependency's verified permission-denied wrapper, so a traversal EACCES or EPERM retains the wrapper; the PR reports matching base-red regressions, but this review executed no target code.

Is this the best way to solve the issue?

The change is the smallest complete repair: extend the existing adapter rather than revert the dependency's intentional classification or introduce another read path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Memory read error normalization keeps the original intent (6619a0e: Retain the admitted filesystem Root through reads and retries while exposing native I/O errors to callers and retry classification.)
  • Scoped extra-path error regression keeps the original intent (fix(memory): report relevant extra-path read errors #139402: Report only relevant filesystem errors while permitting another configured root to authorize the file; later test consolidation retained this contract.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6619a0e adds packages/memory-host-sdk/src/host/read-file.ts:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6619a0e5eb7d; files: packages/memory-host-sdk/src/host/read-file.ts)
  • Sebastien Tardif: Raw commit 4b57794 adds packages/memory-host-sdk/src/host/read-file.ts:138 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4b577944c859; files: packages/memory-host-sdk/src/host/read-file.ts)

PR surface

Source 0, Tests +7. Total +7 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 49 42 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 51 44 +7

Labels

Label changes:

  • add P2: Repairs permission-error diagnostics for inaccessible memory files without changing successful reads or filesystem access.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Repairs permission-error diagnostics for inaccessible memory files without changing successful reads or filesystem access.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 30, 2026, 12:59 PM ET / 16:59 UTC.

@roboclaw-bot
roboclaw-bot merged commit 8f1ef6c into main Oct 30, 2026
214 checks passed
@roboclaw-bot
roboclaw-bot deleted the main-ci/memory-native-permission-20261030 branch October 30, 2026 17:11
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

serg0x added a commit to serg0x/openclaw that referenced this pull request Oct 30, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
Normalize fs-safe permission-denied causes through the existing memory
read adapter so scoped EACCES/EPERM diagnostics retain their shipped shape.

Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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