Skip to content

Agent reads of unsaved new files (only in editor buffer) return file-not-found #417

@arul28

Description

@arul28

⚠️ Correction (re-verified 2026-05-31): This is still OPEN on main. The "Fixed by PR #397" note below is incorrect — PR #397 is still open/unmerged and its commit (611b5394) never reached main.

Severity: High · from 2026-05-29 audit.

After #393, agents can read unsaved edits to existing files but new files that exist only in the Files editor buffer (not yet saved to disk) still return file-not-found. readAgentAccessibleFileBytes (utils.ts) and readFileRange (readFileRange.ts) resolve paths with allowMissing:false, throwing before the dirty-buffer lookup runs.

Fix: resolve agent read paths with allowMissing:true when a dirty-lookup is configured, and map ENOENT back to the file-not-found tool error when no buffer exists (workspace boundary still enforced).

Fixed by PR #397. — incorrect; #397 is unmerged (see correction above). Either land #397 after review or re-implement the fix.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions