-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Description
What happened?
Description
The memory discovery process in the CLI currently attempts to read files named GEMINI.md. However, if a directory exists with the same name (GEMINI.md), the fs.readFile operation fails with an EISDIR error, which triggers unnecessary warnings in the logs.
Proposed Solution
Implement an EAFP pattern in packages/core/src/utils/memoryDiscovery.ts to attempt reading the file and catch the EISDIR error. If a directory is found, it should be skipped silently or logged as a debug message. This avoids potential TOCTOU (Time-of-check to time-of-use) race conditions and handles symlinks more robustly.
This issue is related to PR #15866.
What did you expect to happen?
The memory discovery process should skip directories named GEMINI.md silently. It should not throw an EISDIR error or show warnings to the user, as directories with that name are valid in certain project structures and should simply be ignored in favor of actual files.
Client information
Client Information
> /about
- Version: 0.25.0-nightly.20260107.59a18e710
- Platform: Windows
- Node.js: v24.7.0Login information
No response
Anything else we need to know?
No response