Files
gemini-cli/packages
Philippe Granger c904f4cece fix: resolve infinite loop when using 'Modify with external editor' (#7669)
This fix addresses the infinite loop issue reported in #7669 where selecting
"Modify with external editor" would loop indefinitely when no editor was
configured or available.

Root cause: When getPreferredEditor() returned undefined, the code silently
returned without changing the outcome, causing the while loop to repeat.

Changes:
- Add detectFirstAvailableEditor() to auto-detect available editors
- Add resolveEditor() to handle editor resolution with proper error messages
- Update confirmation.ts to break the loop and show error when editor unavailable
- Update coreToolScheduler.ts to cancel operation with feedback when editor unavailable
- Add 11 new tests for the new editor resolution functions

The fix:
1. Properly validates editor availability before attempting to use it
2. Auto-detects an available editor if none is configured
3. Provides clear error messages explaining why the editor cannot be used
4. Breaks the loop gracefully instead of looping infinitely
2026-01-22 21:25:40 +01:00
..