Skip to content

fix(memory): report relevant extra-path read errors - #139402

Merged
obviyus merged 3 commits into
openclaw:mainfrom
SebTardif:fix/memory-extra-path-lstat-errors
Sep 6, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
SebTardif:fix/memory-extra-path-lstat-errors

Conversation

@SebTardif

@SebTardif SebTardif commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where memory_get returns path required when a requested Markdown note is under an inaccessible configured extra-memory root. The same diagnostic is lost when access fails below an otherwise accessible root.

Why This Change Was Made

Select relevant file or directory/glob entries in the existing authorization loop. Retain an operational filesystem error while checking whether a later configured root can authorize the read, then report that error only if no root succeeds. Preserve missing-path handling and the existing containment and symlink checks.

User Impact

Operators receive the relevant permission or I/O error. An unrelated broken root does not block a healthy note or replace an unauthorized-path denial. Explicit files, glob restrictions, workspace memory, and bounded excerpts retain their existing behavior.

Evidence

  • Real isolated Linux Gateway agent turns invoked the shipped memory_get tool with a deterministic provider and real filesystem permissions.
  • Main at 8d53f3023ec46a68d1a1780fd3727b4e72931b2e returned path required for an inaccessible root and a denied child path. Candidate ae8e7042fd5ce40b8be26e5f4dc867c5d09082f0 returned the relevant EACCES; both returned empty text.
  • Healthy later-root reads succeed. Unauthorized requests retain path required without unrelated diagnostics or note contents.
  • Regression cases fail on main for lost diagnostics and on the original patch for blocking healthy reads. The repaired reader and related memory-tool/excerpt suites pass all 70 tests.
  • Focused type-aware lint, pinned formatting, assertion-safety and size guards pass. Baseline and candidate Gateway builds pass.
  • Independent source-blind acceptance passed all eight prewritten clauses with four baseline and 26 candidate Gateway turns. Controls included symlinks to both unauthorized and authorized targets, globs, missing roots/files, workspace and explicit-file boundaries, extensions, traversal, excerpts, and recovery after restoring file permissions.
  • Live permission proof used Linux EACCES; EIO is covered by injected owner-boundary regression tests.

Configured extra paths that fail lstat with EACCES or EIO were swallowed
and reported as path required. Rethrow operational filesystem errors and
keep skipping only missing extra paths.

Signed-off-by: Sebastien Tardif <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 5, 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.

@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 11:32 PM ET / September 6, 2026, 03:32 UTC.

ClawSweeper review

What this changes

The memory-file reader reports relevant permission and I/O errors while preserving healthy reads through other configured roots and rejecting unrelated paths.

Merge readiness

⛔ Blocked before merge - 1 item remains

The fix remains necessary on current main. The revised branch resolves the previous multi-root finding, and the supplied Gateway observations support the intended behavior without exposing a remaining blocking defect.

Priority: P2
Reviewed head: ae8e7042fd5ce40b8be26e5f4dc867c5d09082f0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant production observations and regression coverage; the prior blocking finding is resolved.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured PR body records the changed reader exercised through real Linux Gateway memory_get turns at the candidate SHA: relevant EACCES replaced path required, healthy reads succeeded, unauthorized reads returned no contents, and permission restoration recovered reads.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured PR body records the changed reader exercised through real Linux Gateway memory_get turns at the candidate SHA: relevant EACCES replaced path required, healthy reads succeeded, unauthorized reads returned no contents, and permission restoration recovered reads.
Evidence reviewed 8 items Introduced repair and prior finding resolution: The complete host-pinned introduced diff and checked-out reader show candidate filtering before lstat, deferred relevant errors, and continued consideration of later roots. These directly address the previous review's healthy-root and unrelated-path concerns.
Current main still needs the fix: Fetched main retains the blanket catch around configured extra paths and converts validation failure to path required; it does not contain the proposed diagnostic repair.
Latest release comparison: The v2026.9.2 reader also swallows extra-path inspection errors, so the supplied latest release does not already solve the reported diagnostic problem.
Findings None None.
Security None None.

How this fits together

The memory_get tool passes a requested note path and agent configuration to the memory-file reader. The reader validates workspace or extra-path access, then returns a bounded excerpt or an error that the tool presents to the agent.

flowchart TD
  A[Agent requests memory note] --> B[Workspace and extra-path configuration]
  B --> C[Match eligible roots and globs]
  C --> D[Check containment and symlinks]
  D --> E[Read bounded note excerpt]
  D --> F[Retain relevant filesystem error]
  F --> C
  E --> G[Memory tool result]
  F -->|No root succeeds| G
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +17, Tests +82. Total +99 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 27 10 +17
Tests 1 82 0 +82
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 109 10 +99

Review metrics

None.

Stored data model

Persistent data-model change detected: unknown-data-model-change: packages/memory-host-sdk/src/host/read-file.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep diagnostic selection in the existing reader, preserving eligible-root fallback, access restrictions, and bounded results.

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

Yes: current-main source deterministically replaces an extra-root inspection failure with path required, and the supplied Linux Gateway observations demonstrate that trigger on the pinned baseline. This review did not execute target code.

Is this the best way to solve the issue?

Yes: filtering eligible candidates and retaining errors until all matching roots are considered repairs the owning loop without adding another API or changing successful reads.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured PR body records the changed reader exercised through real Linux Gateway memory_get turns at the candidate SHA: relevant EACCES replaced path required, healthy reads succeeded, unauthorized reads returned no contents, and permission restoration recovered reads.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs misleading diagnostics for inaccessible configured memory paths with limited impact on otherwise working reads.
  • 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): The captured PR body records the changed reader exercised through real Linux Gateway memory_get turns at the candidate SHA: relevant EACCES replaced path required, healthy reads succeeded, unauthorized reads returned no contents, and permission restoration recovered reads.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured PR body records the changed reader exercised through real Linux Gateway memory_get turns at the candidate SHA: relevant EACCES replaced path required, healthy reads succeeded, unauthorized reads returned no contents, and permission restoration recovered reads.

Evidence

What I checked:

  • Introduced repair and prior finding resolution: The complete host-pinned introduced diff and checked-out reader show candidate filtering before lstat, deferred relevant errors, and continued consideration of later roots. These directly address the previous review's healthy-root and unrelated-path concerns. (packages/memory-host-sdk/src/host/read-file.ts:99, ae8e7042fd5c)
  • Current main still needs the fix: Fetched main retains the blanket catch around configured extra paths and converts validation failure to path required; it does not contain the proposed diagnostic repair. (packages/memory-host-sdk/src/host/read-file.ts:129, 9a8fb392dff3)
  • Latest release comparison: The v2026.9.2 reader also swallows extra-path inspection errors, so the supplied latest release does not already solve the reported diagnostic problem. (packages/memory-host-sdk/src/host/read-file.ts:129, 3928bad9badf)
  • Regression and compatibility coverage: The complete tests cover EACCES and EIO, healthy later roots, denied child paths, explicit-file fallback, unrelated requests, extensions, and glob exclusion. Existing sibling coverage protects missing files, symlink rejection, and bounded excerpts. Tests were inspected, not executed. (packages/memory-host-sdk/src/host/read-file.test.ts:57, ae8e7042fd5c)
  • Production tool boundary: memory_get invokes readAgentMemoryFile; executeMemoryReadResult presents thrown failures with empty text and a formatted error. The patch changes diagnostic selection without changing the tool signature or successful result contract. (extensions/memory-core/src/memory-read-tool.ts:56, ae8e7042fd5c)
  • Captured after-fix production observations: The supplied complete PR body, captured under sourceRevision fbedd609d4e25a0718bdbe20576a719b6b9435443f1b2c76b3afcb02131064b3, records real isolated Linux Gateway memory_get turns: baseline 8d53f30 returned path required, candidate ae8e704 returned EACCES with empty text, healthy reads succeeded, and unauthorized requests remained denied. It reports four baseline and 26 candidate turns covering symlinks, globs, missing paths, explicit files, excerpts, and permission recovery. EIO evidence is injected regression coverage rather than a live filesystem failure. (ae8e7042fd5c)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • samzong: 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 (1 earlier review cycle)
  • reviewed 2026-09-05T21:21:34.148Z sha a6a4918 :: blocked before merge. :: [P1] [P1] Scope filesystem errors to relevant extra-path candidates

@obviyus obviyus self-assigned this Sep 6, 2026
@obviyus obviyus changed the title fix(memory): surface extra-path lstat errors on memory reads fix(memory): report relevant extra-path read errors Sep 6, 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. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 6, 2026
@obviyus
obviyus merged commit 4b57794 into openclaw:main Sep 6, 2026
190 checks passed
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks @SebTardif!

Proof: real Linux Gateway agent turns invoked the shipped memory_get tool with synthetic notes and real file permissions.

  • Bug: inaccessible extra-memory paths returned path required, hiding the filesystem error.
  • Fix: report the relevant error while preserving reads through other authorized roots.
Before After
Inaccessible root or child: path required Relevant EACCES, with no file contents
Original patch blocks a healthy later root Healthy later-root and explicit-file reads succeed
Unauthorized request Still path required, with no unrelated diagnostic

All 70 focused tests passed. Independent acceptance passed all eight clauses across four baseline and 26 candidate Gateway turns. Symlinks, globs, missing paths, workspace boundaries, excerpts, and permission recovery were checked. Live proof covered EACCES; injected regression tests also covered EIO.

Exact-head CI passed. Final independent review passed with no findings. Merged as 4b577944c8597c2d0c6406a1c214b412f68d0e8a; landed files match the reviewed head.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 6, 2026
## What Problem This Solves

Fixes an issue where `memory_get` returns `path required` when a requested Markdown note is under an inaccessible configured extra-memory root. The same diagnostic is lost when access fails below an otherwise accessible root.

## Why This Change Was Made

Select relevant file or directory/glob entries in the existing authorization loop. Retain an operational filesystem error while checking whether a later configured root can authorize the read, then report that error only if no root succeeds. Preserve missing-path handling and the existing containment and symlink checks.

## User Impact

Operators receive the relevant permission or I/O error. An unrelated broken root does not block a healthy note or replace an unauthorized-path denial. Explicit files, glob restrictions, workspace memory, and bounded excerpts retain their existing behavior.

## Evidence

- Real isolated Linux Gateway agent turns invoked the shipped `memory_get` tool with a deterministic provider and real filesystem permissions.
- Main at `4a21576790a5e960e1070b7bf7ce10c6a8d06689` returned `path required` for an inaccessible root and a denied child path. Candidate `ae8e7042fd5ce40b8be26e5f4dc867c5d09082f0` returned the relevant `EACCES`; both returned empty text.
- Healthy later-root reads succeed. Unauthorized requests retain `path required` without unrelated diagnostics or note contents.
- Regression cases fail on main for lost diagnostics and on the original patch for blocking healthy reads. The repaired reader and related memory-tool/excerpt suites pass all 70 tests.
- Focused type-aware lint, pinned formatting, assertion-safety and size guards pass. Baseline and candidate Gateway builds pass.
- Independent source-blind acceptance passed all eight prewritten clauses with four baseline and 26 candidate Gateway turns. Controls included symlinks to both unauthorized and authorized targets, globs, missing roots/files, workspace and explicit-file boundaries, extensions, traversal, excerpts, and recovery after restoring file permissions.
- Live permission proof used Linux `EACCES`; `EIO` is covered by injected owner-boundary regression tests.

Co-authored-by: Ayaan Zaidi <[email protected]>
@SebTardif
SebTardif deleted the fix/memory-extra-path-lstat-errors branch September 10, 2026 21:27
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

2 participants