Skip to content

[WSLC] State-aware exec: forward piped stdin to the container (blocked on WSLC SDK) #804

Closed

Description

Description of the new feature / enhancement

The state-aware WSLc backend's exec path (execInSandbox) streams container stdout/stderr live, but it does not forward host stdin to the container process. Anything piped to a WSLc exec (e.g. echo data | ... exec, or exec < file) is dropped, and the container child sees immediate EOF on stdin.

The Windows Sandbox (WSB) state-aware backend already supports piped (non-TTY) stdin — the guest agent bridges the child's stdin over its IPC transport (src/backends/windows_sandbox/guest/src/executor.rs bridges TCP → child stdin via tokio::io::copy; src/backends/windows_sandbox/lifecycle/src/state_aware.rs pumps host stdin into Stdin frames). So WSLc lacking stdin forwarding is a backend parity gap, not a design choice.

This is currently blocked on the WSLc SDK. Live stdout/stderr streaming is implemented by registering the SDK's onStdOut/onStdErr process callbacks. Per the WSLc SDK header (wslcsdk.h):

Using any callbacks will consume the IO handles, preventing acquisition through WslcGetProcessIOHandle.

Because the daemon registers output callbacks (the basis of live output streaming), WslcGetProcessIOHandle(WSLC_PROCESS_IO_HANDLE_STDIN) is unavailable — callback-mode output and handle-mode stdin are mutually exclusive in the current SDK. There is no way to forward stdin while also using callback-based output streaming.

Scope: this issue covers piped (non-TTY) stdin. Interactive TTY/ConPTY stdin is a further step on top (WSB tracks that separately as h6-pty-plumbing).

Proposed technical implementation details

Once the WSLc SDK allows acquiring the stdin handle alongside output (or provides an equivalent stdin-write API that coexists with output delivery), rearchitect the WSLc daemon exec path from callback-mode to handle-mode:

  • Register no output callbacks; instead acquire all three IO handles via WslcGetProcessIOHandle.
  • Spawn ReadFile threads for stdout/stderr feeding the existing streaming sink + capped capture buffers.
  • Spawn a WriteFile thread draining client StreamFrame::Stdin frames into the container process stdin handle; close the handle on EOF.
  • Client side: pump non-TTY host stdin → StreamFrame::Stdin (mirroring WSB state_aware.rs); warn + send EOF on TTY stdin.
  • Preserve the current IoContext Arc / kill-leak / exit-callback safety invariants under the new threading model (src/backends/wslc/common/src/container_steps.rs).

Blocked on: WSLc SDK callback/handle exclusivity (wslcsdk.h).

Activity

  1. added
    Issue-Feature
    Needs-Triage
    Backend-WSLC
    and removed
    Needs-Triage
    on Aug 11, 2026
  2. changed the title [-]WSLc state-aware exec: forward piped stdin to the container (blocked on WSLc SDK)[/-] [+][WSLC] State-aware exec: forward piped stdin to the container (blocked on WSLc SDK)[/+] on Aug 11, 2026
  3. added
    OS-Windows
    on Aug 11, 2026
  4. github-actions commented on Aug 11, 2026

    @github-actions

    Triage complete.

    • Labels added: OS-Windows, Area-SDK-Api (existing: Issue-Feature, Container-WSLC)
    • Assigned: Soham Das (@SohamDas2021) (WSLC owner, already assigned), @huzaifa-d (SDK API / executor schema area)

    This is a WSLC state-aware exec parity gap — piped stdin forwarding blocked on WSLc SDK callback/handle exclusivity. The Area-SDK-Api label captures the exec streaming API surface involved.

    Maintainers: Comment /investigate to check whether this issue or bug is valid against the most current code. Copilot will also produce a report with the changes that will be needed. For a small, unambiguous documentation or test fix, it may also create one draft PR.

    Generated by 🏷️ Issue Triage for #804 · 24.7 AIC · ⌖ 5.63 AIC · ⊞ 6.7K · ◷

  5. github-actions commented on Aug 11, 2026

    @github-actions

    Triage complete.

    This issue was already partially triaged with labels Issue-Feature, OS-Windows, Area-SDK-Api, Container-WSLC and owners @huzaifa-d and Soham Das (@SohamDas2021) assigned. No additional labels or owners were needed. Needs-Triage has been removed.

    Maintainers: Comment /investigate to check whether this issue or bug is valid against the most current code. Copilot will also produce a report with the changes that will be needed. For a small, unambiguous documentation or test fix, it may also create one draft PR.

    Generated by 🏷️ Issue Triage for #804 · 16.2 AIC · ⌖ 5.59 AIC · ⊞ 6.7K · ◷

  6. added
    Priority3
    on Aug 22, 2026
  7. changed the title [-][WSLC] State-aware exec: forward piped stdin to the container (blocked on WSLc SDK)[/-] [+][WSLC] State-aware exec: forward piped stdin to the container (blocked on WSLC SDK)[/+] on Aug 26, 2026
  8. github-actions commented on Aug 26, 2026

    @github-actions

    Triage summary

    This issue is already appropriately labeled and assigned. No label or owner changes were needed:

    • Labels confirmed: OS-Windows, Container-WSLC, Area-SDK-Api — all accurate for a WSLc state-aware exec stdin-forwarding feature blocked on the WSLc SDK.
    • Owner confirmed: Soham Das (@SohamDas2021) (WSLc / Linux / Bubblewrap area) is already assigned.
    • Needs-Triage was not present and was not added.

    Maintainers: Comment /investigate to check whether this issue or bug is valid against the most current code. Copilot will also produce a report with the changes that will be needed. For a small, unambiguous documentation or test fix, it may also create one draft PR.

    Generated by 🏷️ Issue Triage for #804 · sonnet46 · 21.2 AIC · ⌖ 5.26 AIC · ⊞ 7.7K · ◷

  9. SohamDas2021 commented on Sep 2, 2026

    @SohamDas2021
    ContributorAuthor

    Tracked in ADO.

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

Metadata

Metadata

Labels

Backend-WSLCIssue-FeatureOS-WindowsPriority3

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions