Unexpected behavior when using `stop=True` on ray.autoscaler.sdk

I’m loving the ray.autoscaler.sdk so far, but ran into unexpected behavior when running run_on_cluster(cmd=MY_COMMAND, stop=True). The command that was sent was:

... MY_COMMAND stop; ray teardown /root/ray_bootstrap_config.yaml --yes --workers-only)'"'"'"'"'"'"'"'"''"'"' ; sudo shutdown -h now)'

Notice the stop that follows my command. This resulted in the error:
Usage: run_pipeline.py [OPTIONS]

Try 'run_pipeline.py --help' for help.

Error: Got unexpected extra argument (stop)

I was able to resolve this by running:

run_on_cluster(cmd=f"{MY_COMMAND};", stop=True)

which produced

... MY_COMMAND;ray stop; ray teardown /root/ray_bootstrap_config.yaml --yes --workers-only)'"'"'"'"'"'"'"'"''"'"' ; sudo shutdown -h now)'

Is this expected behavior? It wasn’t to me, so I figured I’d let y’all know per the discussion here Recommended way to submit ray job programmatically? - #2 by rliaw . I’m running Ray 1.1.0.

Also worth noting is that on successful command completion and job shutdown, ray reports that the command failed:

Stopped all 12 Ray processes.
Loaded cached provider configuration
If you experience issues with the cloud provider, try re-running the command with --no-config-cache.
Destroying cluster. Confirm [y/N]: y [automatic, due to --yes]
The head node will not be shut down. (due to --workers-only)
No nodes remaining.
Shared connection to closed.
Error: Command failed:

  ssh -tt -i /Users/matthewcox/.ssh/ray-autoscaler_us-east-1.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ExitOnForwardFailure=yes -o ServerAliveInterval=5 -o ServerAliveCountMax=3 -o ControlMaster=auto -o ControlPath=/tmp/ray_ssh_6874701374/8305700b12/%C -o ControlPersist=10s -o ConnectTimeout=120s ubuntu@ bash --login -c -i 'true && source ~/.bashrc && export OMP_NUM_THREADS=1 PYTHONWARNINGS=ignore && (docker exec -it  ray_container /bin/bash -c '"'"'bash --login -c -i '"'"'"'"'"'"'"'"'true && source ~/.bashrc && export OMP_NUM_THREADS=1 PYTHONWARNINGS=ignore && MY_COMMAND;ray stop; ray teardown /root/ray_bootstrap_config.yaml --yes --workers-only)'"'"'"'"'"'"'"'"''"'"' ; sudo shutdown -h now)'

cc @ijrsvt Can you address this question?