Skip to content

Question: winapp target exec – timeout, process termination and output preservation in Windows Sandbox #1308

Open

Description

@Krisztian12345678

Hello winapp CLI team,

We are evaluating winapp CLI for running a small, synthetic JavaScript component test inside Windows Sandbox.

Before implementing any custom process supervisor, we would like to understand which execution and safety guarantees are already provided by the released winapp CLI.

We have not yet executed this setup. This is a capability question, not a bug report.

We would appreciate clarification on the following points:

  1. Execution timeout

Does winapp target exec sandbox provide a supported way to enforce a maximum execution time, including process startup, execution, stdout/stderr draining, and shutdown?

  1. Process termination

What happens to the guest process and its child processes if the host CLI is cancelled, terminated unexpectedly, or loses its connection to the Sandbox?

Is actual process-tree termination observable or confirmed separately from requesting cancellation?

  1. Output preservation

If execution is interrupted, what happens to stdout/stderr data already forwarded to the host? Is partial or truncated output explicitly distinguishable from complete output?

Are output-size limits available?

  1. Retry and recovery

Can the same guest command be automatically restarted during reconnection or recovery? Can callers distinguish an attempt that definitely did not start from one whose outcome is unknown?

  1. Existing integration

If some of these guarantees are outside winapp CLI's responsibility, is there an existing supported Windows or winapp integration that provides them without implementing a custom supervisor?

If possible, please identify the relevant released version, documentation, implementation, or tests.

Our goal is to determine whether an existing, safely supervised execution path can be used before developing additional infrastructure.

Thank you for your help!

Activity

  1. chiaramooney commented on Nov 12, 2026

    @chiaramooney
    Contributor
    1. Execution timeout: Currently, there is no configurable end-to-end timeout covering startup, execution, output draining, and shutdown. Internal cancellation timeouts support cleanup, but they are not an overall execution deadline. If you'd like that feature, please file a feature request describing your scenario.

    2. Process termination: On cancellation, winapp closes the guest process’s stdin, allows a five-second graceful-stop period, then terminates remaining processes through a Windows Job Object, which groups the process and its descendants. The host waits for a guest completion response rather than only sending cancellation. Detected connection loss also triggers cleanup for target exec operations. However, currently there is no guaranteed connection-loss detection time or separate public confirmation that every descendant has terminated.

    3. Output preservation: Output already forwarded to the host remains available wherever the caller captured it. Normal completion waits for output draining, and cancellation continues forwarding output while cleanup proceeds. Forced termination or connection loss can still leave incomplete output. Currently, there is no explicit completeness/truncation field or configurable total output-size limit. --json formats winapp errors, not the child’s output.

    4. Retry and recovery: winapp does not automatically replay an interrupted guest command. Connection retries occur before command submission. Some failures establish that the command did not start, but interrupted submission can leave its outcome unknown. Currently, there is no general public attempt-status or recovery lookup, so callers should not assume an interrupted command is safe to retry.

    If there is a feature you would like to see added to winapp CLI, please file a feature request describing your scenario. We are actively working to improve the CLI for our users.

  2. Krisztian12345678 commented on Nov 13, 2026

    @Krisztian12345678
    Author

    Chiara Mooney (@chiaramooney)

    Thank you, Chiara — this is very helpful, especially the distinction between cancellation cleanup and an end-to-end execution deadline.

    Before deciding whether to submit feature requests, could you clarify two remaining points from the original question?

    1. Which released winapp CLI version or tag does this description apply to? A documentation, implementation, or test reference for the cancellation and command-submission behavior would help us bind the assessment to a concrete release.
    2. Regarding question 5, is there an existing supported Windows or winapp integration that supplies the missing execution and result-handling guarantees without a custom supervisor? If you are not aware of one, stating that would also help us avoid assuming such an integration exists.

    We understand that the five-second graceful-stop interval is not an overall execution deadline, and that an interrupted submission with an unknown outcome must not be assumed safe to retry.

    Thank you again.

    1. Execution timeout: Currently, there is no configurable end-to-end timeout covering startup, execution, output draining, and shutdown. Internal cancellation timeouts support cleanup, but they are not an overall execution deadline. If you'd like that feature, please file a feature request describing your scenario.
    2. Process termination: On cancellation, winapp closes the guest process’s stdin, allows a five-second graceful-stop period, then terminates remaining processes through a Windows Job Object, which groups the process and its descendants. The host waits for a guest completion response rather than only sending cancellation. Detected connection loss also triggers cleanup for target exec operations. However, currently there is no guaranteed connection-loss detection time or separate public confirmation that every descendant has terminated.
    3. Output preservation: Output already forwarded to the host remains available wherever the caller captured it. Normal completion waits for output draining, and cancellation continues forwarding output while cleanup proceeds. Forced termination or connection loss can still leave incomplete output. Currently, there is no explicit completeness/truncation field or configurable total output-size limit. --json formats winapp errors, not the child’s output.
    4. Retry and recovery: winapp does not automatically replay an interrupted guest command. Connection retries occur before command submission. Some failures establish that the command did not start, but interrupted submission can leave its outcome unknown. Currently, there is no general public attempt-status or recovery lookup, so callers should not assume an interrupted command is safe to retry.

    If there is a feature you would like to see added to winapp CLI, please file a feature request describing your scenario. We are actively working to improve the CLI for our users.

  3. Krisztian12345678 commented on Nov 18, 2026

    @Krisztian12345678
    Author

    Hi Chiara Mooney (@chiaramooney),

    I wanted to follow up on my clarification from November 13.

    Thank you again for your detailed explanation of the current winapp target exec behavior.

    We are still trying to resolve two remaining questions before making a technical decision:

    1. Which released winapp CLI version or tag does your description apply to? Is there a relevant implementation, test, or documentation reference?

    2. Is there an existing Microsoft-supported integration that provides the missing execution deadline, termination verification, and result-completeness guarantees without requiring a custom supervisor?

    A brief confirmation would be very helpful, including if no such supported integration currently exists.

    These questions are currently blocking part of our development and validation process.

    Thank you for your time and assistance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

questionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions