Repository navigation
fix(read): explain directory paths - #114601
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 5:00 AM ET / 09:00 UTC. ClawSweeper reviewWhat this changesThis PR makes local and sandbox-backed agent read operations explain that a directory must be listed before a specific file can be read. Merge readinessThis PR remains necessary: current main still exposes the raw filesystem directory error at the local read boundary and only treats missing sandbox paths specially. The rewritten head normalizes the local Priority: P2 Review scores
Verification
How this fits togetherThe agent read tool accepts a requested path, routes it to either the local filesystem or a sandbox filesystem bridge, and returns text or an error to the model. This change makes directory mistakes produce the same actionable recovery guidance across both backends. flowchart LR
A[Agent requests read] --> B[Read tool]
B --> C{Local or sandbox backend}
C --> D[Validate requested path]
D --> E[Read file content]
D --> F[Explain directory path]
E --> G[Tool result to model]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +30. Total +43 across 4 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical actionable directory-path message by merging the two owner-boundary checks after the final head’s required validation completes. Do we have a high-confidence way to reproduce the issue? Yes—source establishes the path: local reads propagate a native Is this the best way to solve the issue? Yes—the patch fixes the error at each backend owner without adding a read API, configuration, fallback, or downstream string-based workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f62e42b69fe5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
f0b226b to
0c8962f
Compare
a760132 to
df2a729
Compare
|
@clawsweeper re-review Rewritten at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: ralf003 <[email protected]>
df2a729 to
949e7b7
Compare
|
@clawsweeper re-review Rebased onto live |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: ralf003 <[email protected]>
What Problem This Solves
Fixes an issue where users or agents that passed a directory to the read tool received a raw
EISDIRfailure with no useful recovery direction. The same path could behave differently between local and sandbox-backed reads.Why This Change Was Made
Normalize the filesystem's real
EISDIRresult at the read-tool error boundary, and reject directories at the sandbox bridge owner before its file-read operation. Both paths now return the same actionable instruction without adding a new read API, config surface, or fallback path.User Impact
Directory mistakes now explain that read requires a file path and tell the agent to list the directory before choosing a file. Ordinary file reads are unchanged.
Evidence
949e7b76fd71fc324e27b6f208ff8edc7711746d, based on63651a1878f3d9d6b6de1cb9d2ac3789e5528562.node scripts/run-vitest.mjs src/agents/sessions/tools/read.test.ts src/agents/agent-tools.create-openclaw-coding-tools.test.ts-> 131/131 passed on the final rebased diff.oxfmt, focusedoxlint, temp-directory policy,git diff --check, and TruffleHog passed.Co-authored with the original contributor. AI-assisted; all changes and evidence were reviewed by the maintainer.