What happened?
On Windows, findProjectRoot() can enter a synchronous infinite loop when Senpi is launched from one drive and a rules lookup targets a path on another drive.
resolve("/") points to the current working drive, while dirname() of the target drive root returns the same path. The traversal therefore never progresses or reaches its existing root check. The session freezes without an error, potentially using 100% CPU.
This reproduced with senpi -ne, so it was not caused by a user-loaded extension.
Steps to reproduce
-
On Windows, launch Senpi from the C: drive:
senpi -ne
-
Read, edit, or write a file on another drive, such as D:\senpi-repro\file.txt, where no project marker exists in its parent directories.
-
Observe that the session hangs indefinitely during project-root discovery.
Expected behavior
Project-root traversal should stop when dirname(currentDirectory) === currentDirectory and return null if no marker was found:
const parentDirectory = dirname(currentDirectory);
if (
currentDirectory === filesystemRoot ||
parentDirectory === currentDirectory
) {
return null;
}
### Version
2026.7.29-6
What happened?
On Windows,
findProjectRoot()can enter a synchronous infinite loop when Senpi is launched from one drive and a rules lookup targets a path on another drive.resolve("/")points to the current working drive, whiledirname()of the target drive root returns the same path. The traversal therefore never progresses or reaches its existing root check. The session freezes without an error, potentially using 100% CPU.This reproduced with
senpi -ne, so it was not caused by a user-loaded extension.Steps to reproduce
On Windows, launch Senpi from the
C:drive:senpi -neRead, edit, or write a file on another drive, such as
D:\senpi-repro\file.txt, where no project marker exists in its parent directories.Observe that the session hangs indefinitely during project-root discovery.
Expected behavior
Project-root traversal should stop when
dirname(currentDirectory) === currentDirectoryand returnnullif no marker was found: