You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve Windows CLI spawn ENOENT error in Agent Manager (#4584)
* fix: resolve Windows CLI spawn ENOENT error in Agent Manager
Replace shell command-based CLI detection with filesystem-based
executable resolution using PATHEXT environment variable.
* fix: address PR review comments
- Use error.code instead of error.message for EACCES detection
- Rename fileExistsAsFile to pathExistsAsFile
- Remove redundant isSymbolicLink check (stat follows symlinks)
- Add clarifying comment about symlink behavior
* chore: restore slackbot.md to match main
* fix: add missing getPlatformDiagnostics mock in AgentManagerProvider tests
* fix: use platform-appropriate paths in Windows tests
* fix: separate Windows simulation tests from native Windows tests
- Skip platform-switching tests when already on target platform
- Add dedicated native Windows tests that run only on Windows CI
- Add proper lstat mock to fs mocks (code uses both stat and lstat)
- Use proper error codes in mock rejections
* fix: remove platform simulation tests, keep only native platform tests
Platform simulation (mocking process.platform) is fragile and doesn't
truly test platform-specific behavior. Instead:
- Windows tests run only on Windows CI (skipped elsewhere)
- Non-Windows tests run only on non-Windows (skipped on Windows)
- Let actual CI environments test their native platform behavior
* fix: simplify tests by removing fragile Windows integration test
The Windows .cmd shell:true behavior is already tested in CliProcessHandler.
The PATHEXT resolution is tested in CliPathResolver.spec.ts.
Production code works on Windows (confirmed), so remove complex integration test.
* fix: skip Unix path tests on Windows
Unix-style paths like /usr/bin/kilocode are not absolute on Windows
(Windows requires drive letters like C:\). Skip these tests on Windows
since the Windows-specific behavior is already tested by the PATHEXT tests.
* fix: mock CliInstaller in tests to work on Windows
On Windows, login shell is skipped and findExecutable uses fs.promises.stat
instead of execSync. The tests were relying on execSync returning MOCK_CLI_PATH,
which doesn't work on Windows.
Fix: Mock getLocalCliPath() to return MOCK_CLI_PATH and make fileExistsAtPath
return true for that path. This ensures findKilocodeCli finds the CLI via the
local path check on all platforms.
0 commit comments