Repository navigation
Description
Description of the task
Today the WSLC backend surfaces SDK/HRESULT failures as free-text ScriptResponse errors. In src/backends/wslc/common/src/container_steps.rs the shared sdk_error() helper formats a string and calls ScriptResponse::error(&msg) (container_steps.rs:56-62), so callers and the Rust SDK only ever see an opaque message string with no machine-readable discriminant.
Follow-on from PR review feedback on PR #745 (reviewer Branden Bonaby (@bbonaby)):
question: I thought for ScriptResponse errors now we try to encapsulate the error in an enum error type since this would help the rust sdk. Could be wrong though but that seemed like a good error pattern.
Encapsulate WSLC error outcomes in a typed enum so the Rust SDK (and any other consumer) can match on the error kind instead of parsing strings.
Scope:
- Introduce a typed error enum for the WSLC backend's failure modes (e.g. SDK/HRESULT failures, prerequisite-missing, validation/policy rejection, transport) rather than folding everything into a
ScriptResponsemessage string. - Route
sdk_error()and the other WSLC error construction sites through the typed enum, preserving the existing human-readable message viaDisplay. - Map the typed enum to the SDK-facing error surface /
ErrorCodeso callers get a stable discriminant. - Preserve current behavior and messages — no functional change to what a user sees; validate with existing WSLC E2E on a live WSL host.
Additional context
- Anchor:
src/backends/wslc/common/src/container_steps.rs:62(ScriptResponse::error(&msg)). - Non-blocking; deferred from PR [WSLC] State-aware lifecycle (PR 1/3): persistent daemon + named-pipe IPC control plane #745 as an error-pattern improvement, not a correctness fix.
Activity
github-actions commentedon Aug 9, 2026
Triage summary
Area-SDK-Api(in addition to existingOS-Windows,Container-WSLC)This task targets the WSLC backend's error surface in
src/backends/wslc/common/src/container_steps.rs, introducing a typed error enum and mapping it to the SDK-facingErrorCode.Area-SDK-Apiapplies because the change is specifically about surfacing stable, machine-readable error discriminants to Rust SDK callers.Maintainers: Comment
/investigateto 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.