fix(acp): convert RESOURCE_NOT_FOUND to ENOENT for fs delegation - #14190
fix(acp): convert RESOURCE_NOT_FOUND to ENOENT for fs delegation#14190codefromthecrypt wants to merge 2 commits into
Conversation
a2447d5 to
6816486
Compare
5ef25a1 to
8adac99
Compare
91eda67 to
d347d1f
Compare
81221ac to
ff8eb30
Compare
|
Hi @codefromthecrypt, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
- processSingleFileContent now uses fileSystemService.readTextFile() to enable delegation to ACP client when fs.readTextFile capability exists - StandardFileSystemService.readTextFile() uses readFileWithEncoding() to preserve BOM handling for non-ACP local file reading - Convert RESOURCE_NOT_FOUND to ENOENT for ACP fs delegation
ff8eb30 to
c1b33cf
Compare
|
@allenhutchison I added integration tests to reproduce the call sites based on the other PR you helped merge. if this is too much or anything lemme know |
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. You can easily reopen this PR once you have linked it to an issue. How to link an issue: Thank you for your understanding and for being a part of our community! |
|
@allenhutchison I backfilled the issue for this and linked it |
Summary
Fix ACP fs delegation error handling: convert RESOURCE_NOT_FOUND errors to
Node.js ENOENT format when reading files via client delegation.
Details
When clients advertise
fs.readTextFilecapability, gemini-cli delegatesfile reads to the client. If the file doesn't exist, the client returns
an error with code -32002 (RESOURCE_NOT_FOUND). This change converts that
error to a Node.js-style ENOENT error so downstream code handles it correctly.
Changes:
connection.ts: Add RESOURCE_NOT_FOUND error code constantfileSystemService.ts: Makecapabilitiespublic readonly, add try/catchin
readTextFile()to convert RESOURCE_NOT_FOUND to ENOENTfileSystemService.test.ts: Add test for ENOENT conversionHow to Validate
fs.readTextFile: truecode: 'ENOENT'instead of raw JSON-RPC errorPre-Merge Checklist
Fixes #17588