Description
The InteractiveSession::start() method hardcodes the shell command as "sh" without any platform detection. This causes the method to fail on Windows where sh is not available by default. Unlike other parts of the codebase that check cfg!(windows) to use cmd on Windows vs sh on Unix, this method unconditionally uses Unix shell syntax.
Verified by comparing with:
CommandExecutor::execute() (lines 196-209): Uses if cfg!(windows) { "cmd" } else { "sh" }
StreamingExecutor::execute() (lines 442-454): Uses same platform detection
InteractiveSession::start() (lines 542-555): Missing platform check, always uses "sh"
Error Message
Failed to spawn: The system cannot find the file specified. (os error 2)
Debug Logs
On Windows, calling InteractiveSession::start("any command") will fail with a file not found error because 'sh' is not in the system PATH.
System Information
Windows platforms
Steps to Reproduce
- On Windows, call InteractiveSession::start("echo hello")
- Observe that it fails with 'file not found' error
- Compare with CommandExecutor which correctly uses 'cmd' on Windows
Expected Behavior
InteractiveSession::start() should detect the platform and use 'cmd /C' on Windows and 'sh -c' on Unix, consistent with other methods in the same file.
Actual Behavior
InteractiveSession::start() always uses 'sh -c' which fails on Windows.
Additional Context
In src/cortex-engine/src/command_executor.rs, lines 542-555, InteractiveSession::start() hardcodes 'sh' as the shell. This is inconsistent with StreamingExecutor::execute() and CommandExecutor::execute() which both check cfg!(windows) to use the appropriate shell for the platform.
Description
The
InteractiveSession::start()method hardcodes the shell command as"sh"without any platform detection. This causes the method to fail on Windows whereshis not available by default. Unlike other parts of the codebase that checkcfg!(windows)to usecmdon Windows vsshon Unix, this method unconditionally uses Unix shell syntax.Verified by comparing with:
CommandExecutor::execute()(lines 196-209): Usesif cfg!(windows) { "cmd" } else { "sh" }StreamingExecutor::execute()(lines 442-454): Uses same platform detectionInteractiveSession::start()(lines 542-555): Missing platform check, always uses "sh"Error Message
Failed to spawn: The system cannot find the file specified. (os error 2)
Debug Logs
On Windows, calling InteractiveSession::start("any command") will fail with a file not found error because 'sh' is not in the system PATH.
System Information
Windows platforms
Steps to Reproduce
Expected Behavior
InteractiveSession::start() should detect the platform and use 'cmd /C' on Windows and 'sh -c' on Unix, consistent with other methods in the same file.
Actual Behavior
InteractiveSession::start() always uses 'sh -c' which fails on Windows.
Additional Context
In src/cortex-engine/src/command_executor.rs, lines 542-555, InteractiveSession::start() hardcodes 'sh' as the shell. This is inconsistent with StreamingExecutor::execute() and CommandExecutor::execute() which both check cfg!(windows) to use the appropriate shell for the platform.