Skip to content

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

@arul28

Description

@arul28

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:479) and readFileRange (readFileRange.ts:40) 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions