Repository navigation
fix(memory): report relevant extra-path read errors - #139402
Conversation
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]>
|
🦞👀 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 5, 2026, 11:32 PM ET / September 6, 2026, 03:32 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +17, Tests +82. Total +99 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest 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. LabelsLabel changes:
Label 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)
|
|
Thanks @SebTardif! Proof: real Linux Gateway agent turns invoked the shipped
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 Exact-head CI passed. Final independent review passed with no findings. Merged as |
## 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]>
What Problem This Solves
Fixes an issue where
memory_getreturnspath requiredwhen 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
memory_gettool with a deterministic provider and real filesystem permissions.8d53f3023ec46a68d1a1780fd3727b4e72931b2ereturnedpath requiredfor an inaccessible root and a denied child path. Candidateae8e7042fd5ce40b8be26e5f4dc867c5d09082f0returned the relevantEACCES; both returned empty text.path requiredwithout unrelated diagnostics or note contents.EACCES;EIOis covered by injected owner-boundary regression tests.