mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-20 16:53:12 -07:00
b55320926d
Updates the policy TOML loader to correctly follow symlinked files and directories. This ensures that users can symbolically link policies across workspaces or fallback paths without the loader failing. Key changes: - Refactored readPolicyFiles to follow symlinks using fs.realpath. - Added recursion for symlinked directories with a visitedPaths tracker to prevent infinite circular traversal. - Added error handling within the directory scanning loop to catch and ignore ENOENT errors, ensuring that broken symlinks do not silently abort the loading of other valid policies in the same directory. - Added comprehensive unit tests for standard symlink behavior, circular symlink protection, and broken symlink resilience. - Updated mocked fs calls in tests to support realpath.