Repository navigation
Conversation
Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
Signed-off-by: Rahool Paliwal <rpaliwal@nvidia.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets a foreground
openshell sandbox create -- <command>without a terminal work on Windows with the MXC driver: the workload's stdout and stderr reach the CLI's own streams, and the CLI returns the workload's exit code. It reuses theopenshell-mainattachment over the in-process SSH server added in #5859, and fills four gaps that kept it from working.Related Issue
Closes #6031
Changes
driver.rs): reject a foreground request only when it also asks for a terminal (await_main_process_attachment && tty), still before provisioning, with a message pointing to--no-ttyor--detach.--detachis unchanged.supervisor/lib.rs): allow a foreground main process when the SSH adapter is present instead of refusing on non-Unix.forward.rs, CLIssh.rs): quote each argument for the Windows command-line parser on Windows.build_proxy_commandused POSIX single quotes, sossh.execould not startopenshell ssh-proxy(CreateProcessWerror 2) and the CLI waited forever. POSIX behavior is unchanged.supervisor-process/ssh.rs): pass the main session torun_ssh_serverinstead ofNone(otherwise everyopenshell-mainrequest answered "no main session is available"), and send the full 32-bit exit status withexit_code_to_wireinstead ofcode.max(0), so a crash code such as0xC0000005is not reported as success.WINDOWS.md,docs/how-it-works/gateways/configuration.mdx, the MXC driver README andskills/openshell-cli/SKILL.mdno longer say foreground attach needs--detach.Example, from the issue:
step1appears on stdout,oopson stderr, the CLI returns and%ERRORLEVEL%is 7.Testing
New tests: a driver admission matrix (
--ttyrejected with no state created; non-TTY foreground and--detachadmitted) and Windows command-line quoting cases, including a case where an argument contains&.Known limitations
windowsd875be6, output can be lost or the exit status can go missing on bursty or long runs. For example,openshell sandbox execof a workload that prints 400 alternating stdout/stderr lines returns about 170 per stream. The supervisor SSH server sent everything in that case, so the loss is later on the relay path. This change does not alter that path.ssh.exe(Win32-OpenSSH 9.5) does not exit after writing to a pipe, so scripts should redirect the CLI's output to files. Noted inWINDOWS.md.--ttyfor the main process is still rejected.Checklist