def test_runspace_state_after_error(windows_bash_session):
    """Test that the runspace remains usable after a command error."""
    # First, execute a command with an error
    error_action = CmdRunAction(command='NonExistentCommand')
    error_result = windows_bash_session.execute(error_action)
    assert isinstance(error_result, CmdOutputObservation)
    assert error_result.exit_code == 1

    # Then, execute a valid command
    valid_action = CmdRunAction(command="Write-Output 'Still working'")
    valid_result = windows_bash_session.execute(valid_action)
    assert isinstance(valid_result, CmdOutputObservation)
    assert 'Still working' in valid_result.content
    assert valid_result.exit_code == 0
Test that the runspace remains usable after a command error.
tests/unit/test_windows_bash.py